Message11699
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? |
|
Date |
User |
Action |
Args |
2007-08-23 14:04:25 | admin | link | issue586899 messages |
2007-08-23 14:04:25 | admin | create | |
|