Browse Source

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

rtmp_test
Ricardo Garcia 14 years ago
parent
commit
e08878f498
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      youtube-dl

+ 3
- 0
youtube-dl 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)


Loading…
Cancel
Save