mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-23 08:17:00 +00:00
Set stdout to binary mode under Windows (fixes issue #218)
This commit is contained in:
parent
a949a3ae6b
commit
e08878f498
1 changed files with 3 additions and 0 deletions
|
@ -94,6 +94,9 @@ def sanitize_open(filename, open_mode):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if filename == u'-':
|
if filename == u'-':
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
import msvcrt
|
||||||
|
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
||||||
return (sys.stdout, filename)
|
return (sys.stdout, filename)
|
||||||
stream = open(filename, open_mode)
|
stream = open(filename, open_mode)
|
||||||
return (stream, filename)
|
return (stream, filename)
|
||||||
|
|
Loading…
Reference in a new issue