From ac006c29ea56af11b1fdb9ef57882220affc687e Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Fri, 22 Jun 2012 00:07:06 +0200 Subject: Always make sure output is in binary mode on Windows. --- src/livestreamer/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3