From af2e24f7e4d3cd1edc309838d17988b3752d7657 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 14 Jun 2020 12:57:31 -0600 Subject: Bugfix: to get raw data from stdin, use buffer Earlier change dropped PY3 version of code in cleanup - read sys.stdin.buffer, not sys.stdin Signed-off-by: Mats Wichmann --- test/redirection.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/redirection.py b/test/redirection.py index 0512e44..f30a2e3 100644 --- a/test/redirection.py +++ b/test/redirection.py @@ -39,13 +39,11 @@ if sys.platform == "win32": msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) - try: with open(sys.argv[1], 'rb') as f: indata = f.read() except IndexError: - source = sys.stdin - indata = source.read() + indata = sys.stdin.buffer.read() sys.stdout.buffer.write(indata) sys.exit(0) -- cgit v0.12