[issue1029] py3k: io.StringIO.getvalue() returns \r\n

Alexandre Vassalotti report at bugs.python.org
Tue Aug 28 00:38:50 CEST 2007


Alexandre Vassalotti added the comment:

> That's why the current behaviour is not correct: When I write('\n'),
> getvalue() currently returns '\r\n'.

Oh, I missed your example in your initial message. So yes, I agree that
StringIO shouldn't translate newlines like that. I attached a patch that
should fix the bug.

However, I would favor removing the "newline" keyword argument, instead.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1029>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_write_nl_translate.patch
Type: text/x-diff
Size: 371 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-bugs-list/attachments/20070827/ec75e860/attachment.patch 


More information about the Python-bugs-list mailing list