fix: scrub control characters from object values headed towards lxml#11040
Merged
jennifer-richards merged 2 commits intoJun 15, 2026
Conversation
jennifer-richards
requested changes
Jun 15, 2026
jennifer-richards
left a comment
Member
There was a problem hiding this comment.
Trivial nit in a comment
| simple_data = simple_data.replace("\x00", "\u2400") | ||
| if options.get(self.OPTION_ESCAPE_XML_INVALID, False) and isinstance(simple_data, str): | ||
| # Replace control chars invalid in XML 1.0 with their Unicode | ||
| # control pictures (U+2400\u2013U+241F) so lxml won't reject the string. |
Member
There was a problem hiding this comment.
I think that \u2013 should just be a hyphen? (Or an en-dash if you want to be true to the code point)
jennifer-richards
approved these changes
Jun 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11040 +/- ##
=======================================
Coverage 88.51% 88.52%
=======================================
Files 334 334
Lines 45102 45103 +1
=======================================
+ Hits 39924 39928 +4
+ Misses 5178 5175 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.