Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:

I think one bug here is that codecs readers use str.splitlines() internally.  
The splitlines method treats a bunch of different characters as line 
separators, unlike io.<file>.readlines().  So, you end up with different 
behavior between doing iter(codecs.getreader(...)) and iter(io.open(...)).

We can argue if str.splitlines() is doing the correct thing, see the table here:
https://docs.python.org/3.8/library/stdtypes.html#str.splitlines

However, it seems clearer to me that readlines() on a codecs reader and on a 
file object should really be splitting lines on the same characters.

----------
nosy: +nascheme
versions:  -Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue18291>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to