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

2007-09-02 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

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

2007-08-29 Thread Guido van Rossum
Guido van Rossum added the comment: I'ev fixed this slightly differently, by simply changing the *default* of the newline argument to StringIO to be "\n". This is a good default; but I see no reason to prevent users from messing with it if they have a need. -- nosy: +gvanrossum resoluti

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

2007-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a new version of the class, which removes the 'newline' argument from the constructor. I also removed the 'encoding' argument, since this is really an implementation detail of the underlying buffer. Index: Lib/io.py

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

2007-08-27 Thread Alexandre Vassalotti
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 s

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

2007-08-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > As far as I know, StringIO should not do any string transformations. (Not sure if you agree with the patch or not) That's why the current behaviour is not correct: When I write('\n'), getvalue() currently returns '\r\n'.

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

2007-08-26 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: As far as I know, StringIO should not do any string transformations. >From PEP-3116 "New I/O", last paragraph of the section "Text I/O": > Another implementation, StringIO, creates a file-like TextIO > implementation without an underlying Buffered I/O obje

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

2007-08-26 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: io.StrinIO.getvalue() correctly decodes bytes from the underlying buffer, but does not translate \r\n to \n. Python 3.0x (py3k, Aug 26 2007, 14:39:16) [MSC v.1400 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more informat