Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-e7c93b7-3.14
Sep 2, 2026
Merged

[3.14] gh-156658: Only XML white space characters are treated as white space (GH-156659)#156826
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-e7c93b7-3.14

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) September 2, 2026 12:32
@serhiy-storchaka
serhiy-storchaka merged commit 7319f4d into python:3.14 Sep 2, 2026
51 of 54 checks passed
@miss-islington
miss-islington deleted the backport-e7c93b7-3.14 branch September 2, 2026 12:58
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