mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-22 22:47:55 +01:00
Set stdout to binary mode under Windows (fixes issue #218)
This commit is contained in:
parent
a949a3ae6b
commit
e08878f498
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user