New submission from Ryosuke Ito: In Python3, fileinput.FileInput.readline() always returns str object at the end, even if in 'rb' mode. Here's a test code.
import fileinput fi = fileinput.input('test_fileinput.py', mode='rb') while True: line = fi.readline() assert isinstance(line, bytes) if not len(line): break It fails in Python3.2 to 3.5. I wrote a patch for this. With it, the test above passes. ---------- files: fileinput.py.diff keywords: patch messages: 253675 nosy: Ryosuke Ito priority: normal severity: normal status: open title: fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode Added file: http://bugs.python.org/file40895/fileinput.py.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25510> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com