]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-91810: Fix regression with writing an XML declaration with encoding='unicode'...
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 14 Jun 2022 04:25:33 +0000 (07:25 +0300)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 04:25:33 +0000 (07:25 +0300)
commitd7db9dc3cc5b44d0b4ce000571fecf58089a01ec
treecc636ef403b128d3d7786e3885a9aa68e7e6ca15
parent8352e322e87ba39c71e578b65ad8ae156ca3e0c7
gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426)

Suppress writing an XML declaration in open files in ElementTree.write()
with encoding='unicode' and xml_declaration=None.

If file patch is passed to ElementTree.write() with encoding='unicode',
always open a new file in UTF-8.
Lib/test/test_xml_etree.py
Lib/xml/etree/ElementTree.py
Misc/NEWS.d/next/Library/2022-06-02-08-40-58.gh-issue-91810.Gtk44w.rst [new file with mode: 0644]