From: Ricardo Garcia Date: Sat, 23 Oct 2010 10:22:42 +0000 (+0200) Subject: Set stdout to binary mode under Windows (fixes issue #218) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=e08878f498c69567b213d781da02187869285a5f;p=youtube-dl Set stdout to binary mode under Windows (fixes issue #218) --- 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)