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.

Author neologix
Recipients benjamin.peterson, neologix, petri.lehtinen, pitrou, sbt, stutzbach
Date 2011-11-05.07:30:22
SpamBayes Score 1.8603693e-07
Marked as misclassified No
Message-id <1320478223.38.0.31964698024.issue13322@psf.upfronthosting.co.za>
In-reply-to
Content
> write() is a bit simpler, since BlockingIOError has 
> a "characters_written" attribute which is meant to inform you of the 
> partial success: we can just reuse that. That said, BlockingIOError 
> could grow a "partial_read" attribute containing the read result...

Now that I think about it, it's probably the best solution:
always raise a BlockingIOError in case of partial write, with characters_written set correctly (sbt's patch).
And do the same thing on partial read/readline, and return the partially read data as an attribute of BlockingIOError (we could also return a characters_read that would indicate the exact number of bytes read: then the user could call read()/read_into() with exactly characters_read).
That could certainly break existing - sloppy - code, but this would be more much consistent than the current behavior.
History
Date User Action Args
2011-11-05 07:30:23neologixsetrecipients: + neologix, pitrou, benjamin.peterson, stutzbach, sbt, petri.lehtinen
2011-11-05 07:30:23neologixsetmessageid: <1320478223.38.0.31964698024.issue13322@psf.upfronthosting.co.za>
2011-11-05 07:30:22neologixlinkissue13322 messages
2011-11-05 07:30:22neologixcreate