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 sbt
Recipients pitrou, sbt
Date 2012-08-21.23:45:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345592757.15.0.784125458163.issue15758@psf.upfronthosting.co.za>
In-reply-to
Content
RawIOBase.readall() does the sensible thing already.  Maybe FileIO should be allowed to inherit it.

The alternative patch (which probably only works for raw unbuffered case)

diff -r ca54c27a9045 Lib/subprocess.py
--- a/Lib/subprocess.py Tue Aug 21 14:54:22 2012 +0100
+++ b/Lib/subprocess.py Wed Aug 22 00:39:32 2012 +0100
@@ -1152,7 +1152,7 @@


         def _readerthread(self, fh, buffer):
-            buffer.append(fh.read())
+            buffer.append(io.RawIOBase.readall(fh))
             fh.close()

produces

amount = 1 MB; time taken = 0.01 secs; rate = 71.42 MB/s
amount = 2 MB; time taken = 0.02 secs; rate = 83.33 MB/s
amount = 4 MB; time taken = 0.04 secs; rate = 105.26 MB/s
amount = 8 MB; time taken = 0.06 secs; rate = 135.59 MB/s
amount = 16 MB; time taken = 0.09 secs; rate = 170.20 MB/s
amount = 32 MB; time taken = 0.17 secs; rate = 190.46 MB/s
amount = 64 MB; time taken = 0.32 secs; rate = 202.52 MB/s
amount = 128 MB; time taken = 0.61 secs; rate = 211.56 MB/s
History
Date User Action Args
2012-08-21 23:45:57sbtsetrecipients: + sbt, pitrou
2012-08-21 23:45:57sbtsetmessageid: <1345592757.15.0.784125458163.issue15758@psf.upfronthosting.co.za>
2012-08-21 23:45:56sbtlinkissue15758 messages
2012-08-21 23:45:56sbtcreate