[New-bugs-announce] [issue5265] StringIO can duplicate newlines in universal newlines mode

Antoine Pitrou report at bugs.python.org
Sat Feb 14 23:36:18 CET 2009


New submission from Antoine Pitrou <pitrou at free.fr>:

This one is a bit strange:

>>> f = io.StringIO("a\r\nb\r\n", newline=None)
>>> f.read()
'a\nb\n'
>>> f = io.StringIO("a\r\nb\r\n", newline=None)
>>> f.read(6)
'a\nb\n'
>>> f = io.StringIO("a\r\nb\r\n", newline=None)
>>> f.read(5)
'a\n\nb\n'

----------
messages: 82132
nosy: alexandre.vassalotti, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: StringIO can duplicate newlines in universal newlines mode
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5265>
_______________________________________


More information about the New-bugs-announce mailing list