diff options
author | Christopher Rosell <chrippa@tanuki.se> | 2012-06-22 00:07:06 +0200 |
---|---|---|
committer | Christopher Rosell <chrippa@tanuki.se> | 2012-06-22 00:07:06 +0200 |
commit | ac006c29ea56af11b1fdb9ef57882220affc687e (patch) | |
tree | d71d05884be2f3c0fd3b2c141d67c72bc7f9d71a /src | |
parent | af8ca6d10cad5b9f0519345f85d7d2778e00122b (diff) |
Always make sure output is in binary mode on Windows.
Diffstat (limited to 'src')
-rw-r--r-- | src/livestreamer/cli.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py index 429c43d..5ce15c5 100644 --- a/src/livestreamer/cli.py +++ b/src/livestreamer/cli.py @@ -2,7 +2,7 @@ import sys, os, argparse, subprocess import livestreamer -from livestreamer.compat import input, stdout +from livestreamer.compat import input, stdout, is_win32 exampleusage = """ example usage: @@ -130,6 +130,10 @@ def output_stream(stream, args): if not out: exit("Failed to open a valid stream output") + if is_win32: + import msvcrt + msvcrt.setmode(out.fileno(), os.O_BINARY) + try: write_stream(fd, out, progress) except KeyboardInterrupt: |