[issue14161] python2 file __repr__ does not escape filename

2012-10-02 Thread Ronny Pfannschmidt
Ronny Pfannschmidt added the comment: wtf? you made it possible to return NULL in some case -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14161 ___

[issue14161] python2 file __repr__ does not escape filename

2012-10-02 Thread Ronny Pfannschmidt
Ronny Pfannschmidt added the comment: sorry for the buzz, i got myself up to date on the c api now why is there still the unicode case? the PyObject_Repr variant should work fine in both cases -- ___ Python tracker rep...@bugs.python.org

[issue14161] python2 file __repr__ does not escape filename

2012-09-30 Thread Ezio Melotti
Ezio Melotti added the comment: Not sure why this is still open -- probably I was just waiting for the buildbots and forgot it open. The issue seems fixed, so I'm going to close it now. -- assignee: - ezio.melotti resolution: - fixed stage: test needed - committed/rejected status:

[issue14161] python2 file __repr__ does not escape filename

2012-03-11 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 6c1964dee98b by Ezio Melotti in branch '2.7': #14161: fix the __repr__ of file objects to escape the file name. http://hg.python.org/cpython/rev/6c1964dee98b -- nosy: +python-dev

[issue14161] python2 file __repr__ does not escape filename

2012-03-11 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 86c749151660 by Ezio Melotti in branch '2.7': #14161: fix compile error under Windows. http://hg.python.org/cpython/rev/86c749151660 -- ___ Python tracker

[issue14161] python2 file __repr__ does not escape filename

2012-03-11 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 6b1fad34d893 by Ezio Melotti in branch '2.7': #14161: fix test failures on Windows. http://hg.python.org/cpython/rev/6b1fad34d893 -- ___ Python tracker

[issue14161] python2 file __repr__ does not escape filename

2012-03-02 Thread Philip Jenvey
Philip Jenvey pjen...@underboss.org added the comment: I think you want to decref the result of PyObject_Repr after the fact, too -- nosy: +pjenvey ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14161

[issue14161] python2 file __repr__ does not escape filename

2012-03-01 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: The attached patch seems to do the trick (not sure if it's the best way to fix the issue though): open('woo\raa') open file 'woo\raa', mode 'r' at 0xb77c2aa8 open('woo\ra\'a', 'w') open file woo\ra'a, mode 'w' at 0xb77c2b88

[issue14161] python2 file __repr__ does not escape filename

2012-03-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: 1. PyObject_Repr() should IMO be preferred (it's the abstract, high-level function). 2. You must check the result for NULL before calling PyString_AsString() on it. -- ___ Python tracker

[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Ronny Pfannschmidt
New submission from Ronny Pfannschmidt ronny.pfannschm...@gmail.com: behaviour: name = 'woo\raa' open(name, 'w') aa', mode 'w' at 0x295a8a0 expected: name = 'woo\raa' open(name, 'w') open file 'woo\raa', mode 'w' at 0x295a8a0 note: don't ask why i tried this chunk of code in the first

[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- components: +Interpreter Core nosy: +eric.araujo, ezio.melotti, pitrou stage: - needs patch versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14161

[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Funny one :D Reproduced on linux: open('/tmp/t\nest', 'w') open file '/tmp/t est', mode 'w' at 0x7f11268a19c0 file_repr in Objects/fileobject.c calls http://docs.python.org/c-api/unicode#PyUnicode_AsUnicodeEscapeString, equivalent to

[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Duh, obviously that code branch is used only for unicode paths: open('/tmp/t\nest', 'w') open file '/tmp/t est', mode 'w' at 0x7f6f0f3dd9c0 open(u'/tmp/t\nest', 'w') open file u'/tmp/t\nest', mode 'w' at 0x7f6f0f3dda50 There does not