[ python-Bugs-925107 ] _Subfile.readline( ) in mailbox.py ignoring self.stop

SourceForge.net noreply at sourceforge.net
Sat Jun 5 11:43:53 EDT 2004


Bugs item #925107, was opened at 2004-03-29 01:31
Message generated for change (Comment added) made by jlgijsbers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925107&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Sye van der Veen (syeberman)
Assigned to: Nobody/Anonymous (nobody)
Summary: _Subfile.readline( ) in mailbox.py ignoring self.stop

Initial Comment:
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.

----------------------------------------------------------------------

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-06-05 17:43

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=925107&group_id=5470



More information about the Python-bugs-list mailing list