Browse Source

use sys.stdout.buffer only on Python3

rtmp_test
Filippo Valsorda 11 years ago
parent
commit
898280a056
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      youtube_dl/utils.py

+ 1
- 1
youtube_dl/utils.py View File

@ -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:


Loading…
Cancel
Save