Eric Smith <e...@trueblade.com> added the comment:

Either use mode 'U' or the io module if you want to match 3.x.

$ python
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> open('testFile').readlines()
['# blaaaaa\r#\r\t# blaaaaaaaa\r\t#\r\t#\r#blaaa\t\r']
>>> open('testFile', 'U').readlines()
['# blaaaaa\n', '#\n', '\t# blaaaaaaaa\n', '\t#\n', '\t#\n', '#blaaa\t\n']
>>> import io
>>> io.open('testFile').readlines()
[u'# blaaaaa\n', u'#\n', u'\t# blaaaaaaaa\n', u'\t#\n', u'\t#\n', u'#blaaa\t\n']

----------
nosy: +eric.smith
resolution:  -> invalid
status: open -> closed

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

Reply via email to