|
|
@ -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.buffer, filename)
|
|
|
|
return (sys.stdout.buffer if hasattr(sys.stdout, 'buffer') else sys.stdout, 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:
|
|
|
|