projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f10b2a9
)
Use sys.stdout.buffer instead of sys.stdout
author
Chirantan Ekbote
<chirantan.ekbote@gmail.com>
Wed, 27 Mar 2013 19:57:11 +0000
(15:57 -0400)
committer
Chirantan Ekbote
<chirantan.ekbote@gmail.com>
Wed, 27 Mar 2013 19:57:11 +0000
(15:57 -0400)
sys.stdout defaults to text mode, we need to use the underlying buffer
instead when writing binary data.
Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 95bd948438830ca7f98ad82decb722de69319bdf..901b5b5ad291686fa653ea39c3d4670d8b7b9dc8 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-329,7
+329,7
@@
def sanitize_open(filename, open_mode):
if sys.platform == 'win32':
import msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
- return (sys.stdout, filename)
+ return (sys.stdout
.buffer
, filename)
stream = open(encodeFilename(filename), open_mode)
return (stream, filename)
except (IOError, OSError) as err: