[pypy-svn] pypy default: Fix large writes on win32 console

amauryfa commits-noreply at bitbucket.org
Tue Mar 22 13:46:11 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r42840:6a4033a99b58
Date: 2011-03-22 13:33 +0100
http://bitbucket.org/pypy/pypy/changeset/6a4033a99b58/

Log:	Fix large writes on win32 console

diff --git a/py/_io/terminalwriter.py b/py/_io/terminalwriter.py
--- a/py/_io/terminalwriter.py
+++ b/py/_io/terminalwriter.py
@@ -81,6 +81,9 @@
         oldcolors = GetConsoleInfo(handle).wAttributes
         attr |= (oldcolors & 0x0f0)
         SetConsoleTextAttribute(handle, attr)
+        while len(text) > 32768:
+            file.write(text[:32768])
+            text = text[32768:]
         file.write(text)
         SetConsoleTextAttribute(handle, oldcolors)
     else:


More information about the Pypy-commit mailing list