From 92bfb5879896ea51293903b687085e7b1ac29b42 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 29 Jul 2010 11:32:24 +0200 Subject: [PATCH] fix bug on writing out objects with terminalwriter on windows --HG-- branch : trunk --- py/_io/terminalwriter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/_io/terminalwriter.py b/py/_io/terminalwriter.py index e7f6b57b9..c140dbb64 100644 --- a/py/_io/terminalwriter.py +++ b/py/_io/terminalwriter.py @@ -204,6 +204,8 @@ class Win32ConsoleWriter(TerminalWriter): attr |= FOREGROUND_BLACK # (oldcolors & 0x0007) SetConsoleTextAttribute(handle, attr) + if not isinstance(self._file, WriteFile): + s = self._getbytestring(s) self._file.write(s) self._file.flush() if oldcolors: