Issue #21075: fileinput.FileInput now reads bytes from standard stream if

binary mode is specified.  Patch by Sam Kimbrel.
This commit is contained in:
Serhiy Storchaka 2014-05-14 21:08:33 +03:00
parent e2d66903e8
commit 946cfc3e23
4 changed files with 17 additions and 2 deletions

View file

@ -320,7 +320,10 @@ class FileInput:
self._backupfilename = 0
if self._filename == '-':
self._filename = '<stdin>'
self._file = sys.stdin
if 'b' in self._mode:
self._file = sys.stdin.buffer
else:
self._file = sys.stdin
self._isstdin = True
else:
if self._inplace: