diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-03 23:27:37 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-03 23:27:37 (GMT) |
commit | 3663abab59a397c971fb7e039f5f91b171be12d8 (patch) | |
tree | dbea97425864c40030db7ecc8f5a04fe90152343 | |
parent | f07c9a1e693359f7f3bedaab55b88f92b5d8c3c9 (diff) | |
parent | bbdc08ea6e5d3f2d9058991a65b6011dfbb8d233 (diff) | |
download | cpython-3663abab59a397c971fb7e039f5f91b171be12d8.zip cpython-3663abab59a397c971fb7e039f5f91b171be12d8.tar.gz cpython-3663abab59a397c971fb7e039f5f91b171be12d8.tar.bz2 |
(merge 3.2) Issue #12451: xml.dom.pulldom: parse() now opens files in binary
mode instead of the text mode (using the locale encoding) to avoid encoding
issues.
-rw-r--r-- | Lib/xml/dom/pulldom.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py index 81a36b0..d5ac8b2 100644 --- a/Lib/xml/dom/pulldom.py +++ b/Lib/xml/dom/pulldom.py @@ -326,7 +326,7 @@ def parse(stream_or_string, parser=None, bufsize=None): if bufsize is None: bufsize = default_bufsize if isinstance(stream_or_string, str): - stream = open(stream_or_string) + stream = open(stream_or_string, 'rb') else: stream = stream_or_string if not parser: @@ -209,6 +209,9 @@ Core and Builtins Library ------- +- Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead + of the text mode (using the locale encoding) to avoid encoding issues. + - Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better conformance to the RFCs: correctly handle Sender and Resent- headers. |