Skip to content

Commit af2e24f

Browse files
committed
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 <[email protected]>
1 parent 63d3027 commit af2e24f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/redirection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@
3939
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
4040
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
4141
42-
4342
try:
4443
with open(sys.argv[1], 'rb') as f:
4544
indata = f.read()
4645
except IndexError:
47-
source = sys.stdin
48-
indata = source.read()
46+
indata = sys.stdin.buffer.read()
4947
5048
sys.stdout.buffer.write(indata)
5149
sys.exit(0)

0 commit comments

Comments
 (0)