This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.moore
Recipients
Date 2002-07-26.14:06:51
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=113328

This is a text vs binary file issue with the mailbox module, not 
with email. The "fp" parameter to the [Portable]UnixMailbox 
class must be opened in binary mode, or incorrect results are 
obtained.

This is caused by the implementation of _Subfile.read() in 
mailbox.py, which assumes that number of characters read is 
the same as the difference between tell() values, an 
assumption which fails for text mode files on Windows.

I would consider this behaviour a bug, and would prefer it to 
be fixed. However, if it is not to be fixed, the documentation 
should be changed to note that the "fp" parameter for the 
mailbox constructor must be opened in binary mode.

For MMDF and Babyl format mailboxes, it's arguably correct, 
as the file format is binary. For Unix mailboxes, the file is text 
format, so opening the file in text mode is not unreasonable.

Question: is the universal newline support in Python 2.3 going 
to mess this up further?
History
Date User Action Args
2007-08-23 14:04:25adminlinkissue586899 messages
2007-08-23 14:04:25admincreate