mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #21075: fileinput.FileInput now reads bytes from standard stream if
binary mode is specified. Patch by Sam Kimbrel.
This commit is contained in:
parent
e2d66903e8
commit
946cfc3e23
4 changed files with 17 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue