cpython: 8939a21bdb94 (original) (raw)

Mercurial > cpython

changeset 68772:8939a21bdb94 3.2

Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on Windows if the file is a TTY to workaround a Windows bug. The Windows console returns an error (12: not enough space error) on writing into stdout if stdout mode is binary and the length is greater than 66,000 bytes (or less, depending on heap usage). [#11395]

Victor Stinner victor.stinner@haypocalc.com
date Sun, 20 Mar 2011 23:36:35 +0100
parents 0b6f6514461e
children 4b3472169493 c60271bb1fb1
files Lib/test/test_os.py Misc/NEWS Modules/_io/fileio.c
diffstat 3 files changed, 33 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_os.py 19 Misc/NEWS 6 Modules/_io/fileio.c 9

line wrap: on

line diff

--- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -90,6 +90,25 @@ class FileTests(unittest.TestCase): self.assertEqual(fobj.read().splitlines(), [b"bacon", b"eggs", b"spam"])

+

+ class TemporaryFileTests(unittest.TestCase): def setUp(self):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,12 @@ What's New in Python 3.2.1? Core and Builtins ----------------- +- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on

--- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -712,7 +712,14 @@ fileio_write(fileio *self, PyObject *arg errno = 0; len = pbuf.len; #if defined(MS_WIN64) || defined(MS_WINDOWS)

#else