Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3.9] gh-91810: ElementTree: Use text file's encoding by default in X…
…ML declaration (GH-91903) (GH-92665) 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 707839b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Automerge-Triggered-By: GH:serhiy-storchaka
- Loading branch information
1 parent
3f2113d
commit bfc88d3
Showing
3 changed files
with
29 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Misc/NEWS.d/next/Library/2022-04-25-10-23-01.gh-issue-91810.DOHa6B.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:class:`~xml.etree.ElementTree.ElementTree` method | ||
:meth:`~xml.etree.ElementTree.ElementTree.write` and function | ||
:func:`~xml.etree.ElementTree.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. |