[Python-3000] Displaying strings containing unicode escapes at the interactive prompt
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Apr 17 03:53:37 CEST 2008
Oleg Broytmann wrote:
> Traceback (most recent call last):
> File "./ttt.py", line 4, in <module>
> open("тест") # filename is in koi8-r encoding
> IOError: [Errno 2] No such file or directory: '\xd4\xc5\xd3\xd4'
In that particular case, I'd say the IOError constructor
is doing the wrong thing -- it should be using something
like
"No such file or directory: '%s'" % filename\
instead of
"No such file or directory: %r" % filename
i.e. %r shouldn't be used as a quick and dirty way to
get a string quoted.
--
Greg
More information about the Python-3000
mailing list