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
___
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
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:
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
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
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
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
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
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
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
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
É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
É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
13 matches
Mail list logo