Skip to content

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

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-e7c93b7-3.15
Open

[3.15] gh-156658: Only XML white space characters are treated as white space (GH-156659)#156825
miss-islington wants to merge 1 commit 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants