A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-August/121397.html below:

[Python-Dev] Raw I/O writelines() broken

[Python-Dev] Raw I/O writelines() broken [Python-Dev] Raw I/O writelines() brokenAntoine Pitrou solipsis at pitrou.net
Mon Aug 20 23:42:56 CEST 2012
On Mon, 20 Aug 2012 23:17:10 +0200
Antoine Pitrou <solipsis at pitrou.net> wrote:
> 
> Hello,
> 
> I was considering a FileIO.writelines() implementation based on
> writev() and I noticed that the current RawIO.writelines()
> implementation is broken: RawIO.write() can return a partial write but
> writelines() ignores the result and happily proceeds to the next
> iterator item (and None is returned at the end).
> 
> (it's probably broken with non-blocking streams too, for the same
> reason)
> 
> In the spirit of RawIO.write(), I think RawIO.writelines() could return
> the number of bytes written (allowing for partial writes).

Another possibility would be a separate RawIO.writev() that would allow
partial writes, and to fix RawIO.writelines() to always do complete
writes.

Regards

Antoine.


-- 
Software development and contracting: http://pro.pitrou.net


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4