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.

classification
Title: _Subfile.readline( ) in mailbox.py ignoring self.stop
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, jlgijsbers, syeberman
Priority: normal Keywords:

Created on 2004-03-28 23:31 by syeberman, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mailbox.diff akuchling, 2004-06-05 15:46 Johannes's patch
Messages (3)
msg20368 - (view) Author: Sye van der Veen (syeberman) * Date: 2004-03-28 23:31
I'm using Python 2.3.3 (on Windows, but that shouldn't 
matter) and I've noticed a problem with the internal 
_Subfile class in mailbox.py.  The readline method 
doesn't consider self.stop if the length argument is not 
None.  It has:
    if length is None:
        length = self.stop - self.pos
when really it should have something like:
    if length is None or length < 0:
        length = remaining
    elif length > remaining:
        length = remaining
which is what the read method does.
msg20369 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-06-05 15:43
Logged In: YES 
user_id=469548

This is correct. After fixing this bug the read() and
readline() methods are identical, except for one function
call, so my patch refactors their bodies into an internal
_read() method.
msg20370 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-07-07 14:09
Logged In: YES 
user_id=11375

Applied to CVS head; thanks, everyone!
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40096
2004-03-28 23:31:58syebermancreate