diff -r 5738c611ff2a Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Sat Mar 05 20:31:42 2011 +0100 +++ b/Lib/test/test_subprocess.py Sat Mar 05 16:16:39 2011 -0800 @@ -119,6 +119,15 @@ env=newenv) self.assertEqual(rc, 1) + def test_stdout_large(self): + # see: issue #11395 + p = subprocess.Popen([sys.executable, "-c", + "print(b'a' * 66000)"], + stderr=subprocess.PIPE) + self.addCleanup(p.stderr.close) + p.wait() + self.assertEqual(p.returncode, 0) + def test_stdin_none(self): # .stdin is None when not redirected p = subprocess.Popen([sys.executable, "-c", 'print("banana")'], diff -r 5738c611ff2a Modules/_io/fileio.c --- a/Modules/_io/fileio.c Sat Mar 05 20:31:42 2011 +0100 +++ b/Modules/_io/fileio.c Sat Mar 05 16:16:39 2011 -0800 @@ -712,6 +712,9 @@ errno = 0; len = pbuf.len; #if defined(MS_WIN64) || defined(MS_WINDOWS) + /* See: issue #11395 */ + if (len> 32000 && isatty(self->fd)) + len = 32000; if (len> INT_MAX) len = INT_MAX; n = write(self->fd, pbuf.buf, (int)len);

AltStyle によって変換されたページ (->オリジナル) /