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.

Title: mailbox._Subfile readline() bug
Type: Stage:
Components: Library (Lib) Versions:
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, jbperez808
Priority: normal Keywords:

Created on 2003-10-05 11:09 by jbperez808, last changed 2022-04-10 16:11 by admin. This issue is now closed.

Messages (3)
msg18565 - (view) Author: Jonathan Perez (jbperez808) Date: 2003-10-05 11:09
mailbox._Subfile's readline() will chop off the first
character of the next line when reading Unix-style
terminated files.  It's surprising no one has mentioned
this before.

The problem lies in line mailbox._Subfile.readline()
itself where self.pos is assigned self.fp.tell()'s
value.  You will need to subtract 1 from self.pos if a
file uses unix-style termination.
msg18566 - (view) Author: Jonathan Perez (jbperez808) Date: 2003-10-06 13:33
Logged In: YES 

There doesn't seem to be a clean way to fix the code.  But
there is a rather satisfactory workaround:  Open the mbox
file in binary mode for Unix (and Mac?) style terminated
files.  This should DEFINITELY be mentioned in the mailbox
module docs.
msg60165 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-01-19 14:14
I guess this bug report is out of date: doesn't seem to contain
a _Subfile class, the ProxyFile.readline() function is one line, and 
there's no self.pos variable either.  Probably 2.5's rewrite of the module 
removed this code.
Date User Action Args
2022-04-10 16:11:38adminsetgithub: 39374
2008-01-19 14:14:52akuchlingsetstatus: open -> closed
resolution: not a bug
messages: + msg60165
2003-10-05 11:09:24jbperez808create