[Python-3000] Displaying strings containing unicode escapes at the interactive prompt

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 17 07:20:32 CEST 2008


Alex Martelli wrote:
> I disagree: I always recommend using %r to display (in an error
> message, log entry, etc), a string that may be in error,

For debugging messages, yes, but not output produced
in the normal course of operation. And "File Not Found"
I consider to be in the latter category -- the user
typed in the wrong file name, but it's still a string,
and should be displayed to him as such.

If it's not a string, the program will most likely
fall over with a TypeError trying to open the file
before it gets as far as constructing an IOError.

-- 
Greg



More information about the Python-3000 mailing list