diff options
author | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2010-10-23 12:22:42 +0200 |
---|---|---|
committer | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2010-10-31 11:28:45 +0100 |
commit | e08878f498c69567b213d781da02187869285a5f (patch) | |
tree | 8e07a37092295d228bd5c6a30cfd3024ec551bb7 | |
parent | a949a3ae6bda6efa3abc3770e49be34653cc613b (diff) |
Set stdout to binary mode under Windows (fixes issue #218)
-rwxr-xr-x | youtube-dl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube-dl b/youtube-dl index 094a4164c..8494be96c 100755 --- a/youtube-dl +++ b/youtube-dl @@ -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) |