Skip to content

fix: scrub control characters from object values headed towards lxml#11040

Merged
jennifer-richards merged 2 commits into
ietf-tools:mainfrom
rjsparks:bleach_inputs_to_lxml
Jun 15, 2026
Merged

fix: scrub control characters from object values headed towards lxml#11040
jennifer-richards merged 2 commits into
ietf-tools:mainfrom
rjsparks:bleach_inputs_to_lxml

Conversation

@rjsparks

Copy link
Copy Markdown
Member

No description provided.

@jennifer-richards jennifer-richards left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial nit in a comment

Comment thread ietf/api/__init__.py Outdated
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that \u2013 should just be a hyphen? (Or an en-dash if you want to be true to the code point)

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.52%. Comparing base (4641d0d) to head (9dd96b3).
⚠️ Report is 7 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jennifer-richards jennifer-richards merged commit af60378 into ietf-tools:main Jun 15, 2026
9 checks passed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants