From 5d7efa2951a2a859ef3e7d1ebb9b82bac0a3bddb Mon Sep 17 00:00:00 2001 From: "erik.smit" Date: Thu, 15 Dec 2016 16:42:11 +0100 Subject: [PATCH] fix unwanted CRLF conversion on windows --- lglaf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lglaf.py b/lglaf.py index 8cafda8..0627495 100755 --- a/lglaf.py +++ b/lglaf.py @@ -373,6 +373,9 @@ def main(): level=logging.DEBUG if args.debug else logging.INFO) # Binary stdout (output data from device as-is) + if sys.platform == "win32": + import os, msvcrt + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) try: stdout_bin = sys.stdout.buffer except: stdout_bin = sys.stdout