1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-05-18 02:59:31 +00:00

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

This commit is contained in:
Ricardo Garcia 2010-10-23 12:22:42 +02:00
parent a949a3ae6b
commit e08878f498

View file

@ -94,6 +94,9 @@ def sanitize_open(filename, open_mode):
"""
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)