diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-16 10:16:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 10:16:30 (GMT) |
commit | 893adbf001e1d47b17180e471439571522338e28 (patch) | |
tree | 72200bb2c06d45ca5e2b111100e4d9ee82c857f4 /Misc | |
parent | e8f2fe355b82a3eb3c64ee6e1c44f31c020cf97d (diff) | |
download | cpython-893adbf001e1d47b17180e471439571522338e28.zip cpython-893adbf001e1d47b17180e471439571522338e28.tar.gz cpython-893adbf001e1d47b17180e471439571522338e28.tar.bz2 |
gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426) (GH-93791)
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.
(cherry picked from commit d7db9dc3cc5b44d0b4ce000571fecf58089a01ec)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-06-02-08-40-58.gh-issue-91810.Gtk44w.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-06-02-08-40-58.gh-issue-91810.Gtk44w.rst b/Misc/NEWS.d/next/Library/2022-06-02-08-40-58.gh-issue-91810.Gtk44w.rst new file mode 100644 index 0000000..e400058 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-06-02-08-40-58.gh-issue-91810.Gtk44w.rst @@ -0,0 +1,2 @@ +Suppress writing an XML declaration in open files in ``ElementTree.write()`` +with ``encoding='unicode'`` and ``xml_declaration=None``. |