Merge pull request #762 from jynnantonix/master

Use sys.stdout.buffer when writing to standard out
pull/732/merge
Filippo Valsorda 2013-03-28 05:11:51 -07:00
commit 59b4a2f0e4
1 changed files with 1 additions and 1 deletions

View File

@ -329,7 +329,7 @@ def sanitize_open(filename, open_mode):
if sys.platform == 'win32': if sys.platform == 'win32':
import msvcrt import msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
return (sys.stdout, filename) return (sys.stdout.buffer, filename)
stream = open(encodeFilename(filename), open_mode) stream = open(encodeFilename(filename), open_mode)
return (stream, filename) return (stream, filename)
except (IOError, OSError) as err: except (IOError, OSError) as err: