Message79919
I thought I'd explained it in detail without having to invoke the
testsuite. If TEMPFN is "tmp\\@test" you get the following failure:
FAILED (failures=1)
test test_file failed -- Traceback (most recent call last):
File "D:\pydev\python\trunk\lib\test\test_file.py", line 175, in
testUnicodeOpen
self.assert_(repr(f).startswith("<open file u'" + TESTFN))
AssertionError: None
It fails, because print repr(f) will start with:
<open file u'tmp\\@test
Essentially, when generating a repr of a fileobject with a string
filename, the string filename is interpolated between the single colons.
But when it generates a repr of a fileobject with a unicode filename,
the unicode name is escaped and then interpolated.
This results in unicode filename fileobjects having a repr with escaped
backslashes, while the string filename fileobjects have a repr where the
backslashes appear unescaped between the colons.
My patch proposes to
a) make sure that the repr(f) is a string containing the repr of the
filename (be it unicode, string or whatever)
b) Fix the testsuite so that both this case and the one testing string
filenames assumes a repr of the filename. |
|
Date |
User |
Action |
Args |
2009-01-15 22:31:41 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, loewis |
2009-01-15 22:31:41 | kristjan.jonsson | set | messageid: <1232058701.65.0.971545626481.issue4927@psf.upfronthosting.co.za> |
2009-01-15 22:30:40 | kristjan.jonsson | link | issue4927 messages |
2009-01-15 22:30:39 | kristjan.jonsson | create | |
|