diff options
author | Raymond Hettinger <python@rcn.com> | 2011-01-30 07:56:03 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-01-30 07:56:03 (GMT) |
commit | 994d38059ada3aefa47c2c62617eee7c98d60d4b (patch) | |
tree | 4c7b52d04057d7324b4f3ad23ff8282d6675c46f /Doc | |
parent | b7deff1ddc2702c7adb18bc22c484103d9460601 (diff) | |
download | cpython-994d38059ada3aefa47c2c62617eee7c98d60d4b.zip cpython-994d38059ada3aefa47c2c62617eee7c98d60d4b.tar.gz cpython-994d38059ada3aefa47c2c62617eee7c98d60d4b.tar.bz2 |
Add entry for the mailbox fixups.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.2.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index aed4852..26d6539 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -2144,6 +2144,34 @@ parameters, the return types will also be an ASCII-encoded byte strings: (Work by Nick Coghlan, Dan Mahn, and Senthil Kumaran in :issue:`2987`, :issue:`5468`, and :issue:`9873`.) +mailbox +------- + +Thanks to a concerted effort by R. David Murray, the :mod:`mailbox` module has +been fixed for Python 3.2. The challenge was that mailbox had been originally +designed with a text interface, but email messages are best represented with +:class:`bytes` because various parts of a message may have different encodings. + +The solution harnessed the :mod:`email` package's binary support for parsing +arbitrary email messages. In addition, the solution required a number of API +changes. + +As expected, the :meth:`~mailbox.Mailbox.add` method for +:class:`mailbox.Mailbox` objects now accepts binary input. + +:class:`~io.StringIO` and text file input are deprecated. Also, string input +will fail early if non-ASCII characters are used. Previously it would fail when +the email was processed in a later step. + +There is also support for binary output. The :meth:`~mailbox.Mailbox.get_file` +method now returns a file in the binary mode (where it used to incorrectly set +the file to text-mode). There is also a new :meth:`~mailbox.Mailbox.get_bytes` +method that returns a :class:`bytes` representation of a message corresponding +to a given *key*. + +(Contributed by R. David Murray with efforts from Steffen Daode Nurpmeso and +Victor Stinner in :issue:`9124`.) + turtledemo ---------- |