Fix JUnit XML escaping for supplementary Unicode#14491
Closed
Sean-Kenneth-Doherty wants to merge 1 commit into
Closed
Fix JUnit XML escaping for supplementary Unicode#14491Sean-Kenneth-Doherty wants to merge 1 commit into
Sean-Kenneth-Doherty wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com>
Author
|
Local/CI validation refresh from my side:\n\n- GitHub Actions matrix is green, including package, check, Read the Docs, pre-commit.ci, codecov/patch, and Python 3.10-3.14/PyPy lanes.\n- .venv/bin/python -m pytest testing/test_junitxml.py::test_invalid_xml_escape -q -> 1 passed\n- .venv/bin/python -m pytest testing/test_junitxml.py -q -> 135 passed, 2 skipped\n- git diff --check origin/main...HEAD -> clean |
Member
|
closing as agentic abuse after ignoring the prior close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14483.
Summary
bin_xml_escape.The previous static regex used
က0-ჿff, but Python\uescapes consume only four hex digits. That left supplementary-plane characters outside the valid XML character range and caused valid emoji/CJK extension characters to be escaped as#x....Validation
.venv/bin/python -m pytest testing/test_junitxml.py::test_invalid_xml_escape -q-> 1 passed.venv/bin/python -m pytest testing/test_junitxml.py -q-> 135 passed, 2 skippeduvx ruff@0.15.12 check src/_pytest/junitxml.py testing/test_junitxml.pyuvx ruff@0.15.12 format --check src/_pytest/junitxml.py testing/test_junitxml.pyuvx --from mypy==2.0.0 --with iniconfig>=1.1.0 --with attrs>=19.2.0 --with pluggy>=1.5.0 --with packaging --with tomli --with types-setuptools --with types-tabulate --with exceptiongroup>=1.0.0rc8 mypy --pretty --show-error-codes --no-warn-unused-ignores src/_pytest/junitxml.py testing/test_junitxml.py-> no issues founduvx --from codespell==2.4.2 codespell --toml=pyproject.toml AUTHORS changelog/14483.bugfix.rst src/_pytest/junitxml.py testing/test_junitxml.pygit diff --check origin/main...HEADChecklist
closes #XYZWto the PR description and/or commits.Co-authored-bycommit trailers.changelogdirectory.AUTHORSin alphabetical order.