Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, casevh, neologix, pitrou, santoso.wijaya, vstinner
Date 2011-03-04.12:31:40
SpamBayes Score 3.60206e-07
Marked as misclassified No
Message-id <1299241901.1.0.872421476632.issue11395@psf.upfronthosting.co.za>
In-reply-to
Content
It may be a windows bug, but it's also an a python regression!
A fix is to limit the number of chars:

===================================================================
--- D:/py3k/Modules/_io/fileio.c   (revision 87824)
+++ D:/py3k/Modules/_io/fileio.c   (copie de travail)
@@ -712,6 +712,8 @@
         errno = 0;
         len = pbuf.len;
 #if defined(MS_WIN64) || defined(MS_WINDOWS)
+        if (len > 32000 && isatty(self->fd))
+            len = 32000;
         if (len > INT_MAX)
             len = INT_MAX;
         n = write(self->fd, pbuf.buf, (int)len);

On my system, errors start at ~52200 (why?). I hope that 32K is low enough... MSVCRT's write() (version vs10.0) uses a buffer of 5K.
History
Date User Action Args
2011-03-04 12:31:41amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, pitrou, vstinner, casevh, neologix, santoso.wijaya
2011-03-04 12:31:41amaury.forgeotdarcsetmessageid: <1299241901.1.0.872421476632.issue11395@psf.upfronthosting.co.za>
2011-03-04 12:31:40amaury.forgeotdarclinkissue11395 messages
2011-03-04 12:31:40amaury.forgeotdarccreate