Commits

Anonymous committed 55bdbbc

Set stdout to binary mode under Windows (fixes issue #218)

  • Participants
  • Parent commits c8705a5

Comments (0)

Files changed (1)

 	"""
 	try:
 		if filename == u'-':
+			if sys.platform == 'win32':
+				import msvcrt
+				msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
 			return (sys.stdout, filename)
 		stream = open(filename, open_mode)
 		return (stream, filename)