]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-91810: ElementTree: Use text file's encoding by default in XML declaration...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 May 2022 17:36:52 +0000 (10:36 -0700)
committerGitHub <noreply@github.com>
Wed, 11 May 2022 17:36:52 +0000 (10:36 -0700)
commit20fec2c265f7f47304041abcafdffe7de9937682
treee3887769d057cd710dddc29e666ac245b2c899c8
parent5ea8a93e1a35bf08153b5d02e9a332cd9b531241
[3.11] gh-91810: ElementTree: Use text file's encoding by default in XML declaration (GH-91903) (GH-92663)

ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.
(cherry picked from commit 707839b0fe02ba2c891a40f40e7a869d84c2c9c5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Automerge-Triggered-By: GH:serhiy-storchaka
Lib/test/test_xml_etree.py
Lib/xml/etree/ElementTree.py
Misc/NEWS.d/next/Library/2022-04-25-10-23-01.gh-issue-91810.DOHa6B.rst [new file with mode: 0644]