(merge 3.2) Issue #12451: pydoc: html_getfile() now uses tokenize.open() to
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 5 Jul 2011 12:31:28 +0000 (14:31 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 5 Jul 2011 12:31:28 +0000 (14:31 +0200)
support Python scripts using a encoding different than UTF-8 (read the coding
cookie of the script).

1  2 
Lib/pydoc.py
Misc/NEWS

diff --cc Lib/pydoc.py
Simple merge
diff --cc Misc/NEWS
index 5d1530adb5a4a0ae2f22d02693d000da14da94bd,0bc7cd76e045ad56de815a87f7141a681720ae44..4f41fb17be4b2e7aecfa606cd4a472b2ab940481
+++ b/Misc/NEWS
@@@ -219,24 -102,8 +219,28 @@@ Core and Builtin
  Library
  -------
  
++- Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support
++  Python scripts using a encoding different than UTF-8 (read the coding cookie
++  of the script).
++
 +- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
 +  if the process has only one pipe.
 +
 +- Issue #12467: warnings: fix a race condition if a warning is emitted at
 +  shutdown, if globals()['__file__'] is None.
 +
 +- Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
 +  instead of text mode using the locale encoding, to avoid encoding issues.
 +
 +- Issue #12451: runpy: run_path() now opens the Python script in binary mode,
 +  instead of text mode using the locale encoding, to support other encodings
 +  than UTF-8 (scripts using the coding cookie).
 +
 +- 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.
 +  conformance to the RFCs:  correctly handle Sender and Resent- headers.
  
  - Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
    the garbage collector while the Heap lock is held.