[issue4927] Inconsistent unicode repr for fileobject
Kristján Valur Jónsson
report at bugs.python.org
Fri Jan 16 10:10:43 CET 2009
Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:
So you are saying that you see no problem with the repr of a fileobject
being generated in different ways depending on the fileobject being
unicode or string?
You see no danger of confusion when one is confonted with
<open file 'foo\bar' ...>
vs.
<open file u'foo\\bar' ...>
You don't think anyone will be surprised when they try to
eval 'foo\bar' as they can with u'foo\\bar' and get nonsensical results?
I maintain that this is a bug in python that ought to be fixed and not
hidden by changing the test suite. If you are going to rely on using
the repr of the fileobject to extract the filename, you better be able
to do that in a consistent manner irrespective of the type of the
underlying filename.
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4927>
_______________________________________
More information about the Python-bugs-list
mailing list