Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xml writing bug introduced in #16388 #16713

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Fix xml writing bug introduced in #16388 #16713

merged 1 commit into from
Jan 2, 2024

Conversation

frobian21
Copy link
Contributor

#16388 introduced a bug where invalid xml could be produced by write_junit_xml, as special characters were no longer being escaped.

The fix is to revert the removal of from xml.sax.saxutils import escape and escape("\n".join(messages)) in the write_junit_xml function.

I've added a small test case which checks that the <, >, & are escaped correctly in the xml.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JelleZijlstra JelleZijlstra merged commit 4aba5ca into python:master Jan 2, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants