projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59b4a2f
)
use sys.stdout.buffer only on Python3
author
Filippo Valsorda
<filippo.valsorda@gmail.com>
Thu, 28 Mar 2013 12:13:03 +0000
(13:13 +0100)
committer
Filippo Valsorda
<filippo.valsorda@gmail.com>
Thu, 28 Mar 2013 12:13:03 +0000
(13:13 +0100)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 901b5b5ad291686fa653ea39c3d4670d8b7b9dc8..49af7d7c081e759d0e560bf81bb086ba601babe8 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.buffer, filename)
+ return (sys.stdout.buffer
if hasattr(sys.stdout, 'buffer') else sys.stdout
, filename)
stream = open(encodeFilename(filename), open_mode)
return (stream, filename)
except (IOError, OSError) as err: