]> granicus.if.org Git - python/commit
#9124: mailbox now accepts binary input and uses binary internally
authorR. David Murray <rdmurray@bitdance.com>
Sun, 30 Jan 2011 06:21:28 +0000 (06:21 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Sun, 30 Jan 2011 06:21:28 +0000 (06:21 +0000)
commitb7deff1ddc2702c7adb18bc22c484103d9460601
treee5d7e4ac76bb92b9063c1828475ec91c2e4f4086
parentb02f7c00aecf2b418dbf4c7762c3fa268163a900
#9124: mailbox now accepts binary input and uses binary internally

Although this patch contains API changes and is rather weighty for an
RC phase, the mailbox module was essentially unusable without the patch
since it would produce UnicodeErrors when handling non-ascii input
at arbitrary and somewhat mysterious places, and any non-trivial amount
of email processing will encounter messages with non-ascii bytes.
The release manager approved the patch application.

The changes allow binary input, and reject non-ASCII string input early
with a useful message instead of failing mysteriously later.  Binary
is used internally for reading and writing the mailbox files.  StringIO
and Text file input are deprecated.

Initial patch by Victor Stinner, validated and expanded by R. David Murray.
Doc/library/mailbox.rst
Lib/mailbox.py
Lib/test/test_mailbox.py
Misc/NEWS