[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-11-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset e27c589e1c6a by Serhiy Storchaka in branch '3.4': Issue #25510: fileinput.FileInput.readline() now returns b'' instead of '' https://hg.python.org/cpython/rev/e27c589e1c6a New changeset 321b34824020 by Serhiy Storchaka in branch '3.5': Issue

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ryosuke for your contribution. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. I don't think we should care about breaking backward compatibility here. Most code tests end-of-files with "not line" or "len(line) == 0", and this work with fixed fileinput as well as with broken. That is why we have received this bug report now,

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-11-01 Thread R. David Murray
R. David Murray added the comment: Ah, I misunderstood the bug report. Yes, this should be OK (I hope :). -- ___ Python tracker ___

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-10-29 Thread Ryosuke Ito
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,

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-10-29 Thread Ryosuke Ito
Changes by Ryosuke Ito : -- type: -> behavior ___ Python tracker ___ ___

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-10-29 Thread Ryosuke Ito
Changes by Ryosuke Ito : -- components: +Library (Lib) versions: +Python 3.5 ___ Python tracker ___

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would be nice to add a test in Lib/test/test_fileinput.py. -- nosy: +serhiy.storchaka stage: -> test needed ___ Python tracker

[issue25510] fileinput.FileInput.readline() always returns str object at the end even if in 'rb' mode

2015-10-29 Thread R. David Murray
R. David Murray added the comment: We need to think carefully about backward compatibility here. -- nosy: +r.david.murray ___ Python tracker ___