Skip to content

[3.15] gh-156658: Only XML white space characters are treated as white space (GH-156659) - #156825

Merged
serhiy-storchaka merged 2 commits into
python:3.15from
miss-islington:backport-e7c93b7-3.15
Oct 10, 2026
Merged

serhiy-storchaka merged 2 commits into
python:3.15from
miss-islington:backport-e7c93b7-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

XML defines white space as " \t\r\n" (see XML 1.0, 2.3), but str.strip()
also strips other characters, such as U+00A0. Such characters could be
lost in ElementTree.indent(), in canonicalize(strip_text=True), and when
parsing with the whitespace-in-element-content feature turned off.
(cherry picked from commit e7c93b7)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

… space (pythonGH-156659)

XML defines white space as " \t\r\n" (see XML 1.0, 2.3), but str.strip()
also strips other characters, such as U+00A0.  Such characters could be
lost in ElementTree.indent(), in canonicalize(strip_text=True), and when
parsing with the whitespace-in-element-content feature turned off.
(cherry picked from commit e7c93b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) October 10, 2026 09:23
@serhiy-storchaka
serhiy-storchaka merged commit 8cfbf3c into python:3.15 Oct 10, 2026
56 checks passed
@miss-islington
miss-islington deleted the backport-e7c93b7-3.15 branch October 10, 2026 09:53
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