Issue #25510: fileinput.FileInput.readline() now returns b'' instead of ''

at the end if the FileInput was opened with binary mode.
Patch by Ryosuke Ito.
This commit is contained in:
Serhiy Storchaka 2015-11-01 16:45:26 +02:00
commit 56275dc1e2
3 changed files with 23 additions and 1 deletions

View file

@ -315,7 +315,10 @@ class FileInput:
return line
if not self._file:
if not self._files:
return ""
if 'b' in self._mode:
return b''
else:
return ''
self._filename = self._files[0]
self._files = self._files[1:]
self._filelineno = 0