[issue1152248] Enhance file.readlines by making line separator selectable
R. David Murray
report at bugs.python.org
Fri May 15 11:18:38 CEST 2009
R. David Murray <rdmurray at bitdance.com> added the comment:
> cat temp
this is$#a weird$#file$#
> ./python
Python 3.1b1+ (py3k:72632:72633M, May 15 2009, 05:11:27)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('temp', newline='$#')
[50354 refs]
>>> f.readlines()
['this is$#', 'a weird$#', 'file$#', '\n']
All I did was comment out the 'newline' argument validity check in textio.c.
----------
keywords: +easy
nosy: +r.david.murray
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1152248>
_______________________________________
More information about the Python-bugs-list
mailing list