[Patches] [ python-Patches-853963 ] Implement lazy read for sockets

SourceForge.net noreply at sourceforge.net
Thu Dec 4 14:13:11 EST 2003


Patches item #853963, was opened at 2003-12-04 02:57
Message generated for change (Settings changed) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=853963&group_id=5470

>Category: None
>Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Samuel Tardieu (samtardieu)
Assigned to: Nobody/Anonymous (nobody)
Summary: Implement lazy read for sockets

Initial Comment:
When a socket is transformed into a file object using
the makefile() method, the resulting object read()
behaviour requires that read(N)
returns N characters or that the end of stream be reached.

This causes problems with XML parsers which call
read(BufferSize) to
get "something", not necessarily a full buffer.

The following patch adds a "lazy" attribute to each
socket._fileobject
instance, the default being set to False in order to be
backward
compatible. If this attribute is set to True, read(N)
will return at least
one character unless the end of stream is reached, and
no more than
N characters.

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

Comment By: Samuel Tardieu (samtardieu)
Date: 2003-12-04 03:47

Message:
Logged In: YES 
user_id=131394

Note: the original problem description came by Pierre
Palatin <pierre.palatin at enst.fr>.

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

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



More information about the Patches mailing list