(original) (raw)

I like the \\x07 solution.

On Tue, Feb 24, 2015 at 10:47 AM, Ethan Furman <ethan@stoneleaf.us> wrote:
On 02/24/2015 10:14 AM, Guido van Rossum wrote:

\> This is about messages from failing file-open operations if the filename contains an escaped character? I'd go slow
\> there too: here are a lot of places where files are opened and messages are printed, both in the C code and in the
\> stdlib. I'm not sure I buy the argument that just echoing the repr() of the name back doesn't help -- the escapes in
\> there are actually useful in case a filename containing garbage chars (or even a trailing space) was read from some
\> other source.

I can attest from my impoverished Windows programming days that looking at

\--> os.listdir('c:\\temp')
SomeErrorMessage about syntax 'c:\\temp'

is not very helpful. There is zero visual indication that the \\ and the t are one character, not two. Changing that
error message to:

SomeErrorMessage about syntax 'c:\[\\t\]emp'

or

SomeErrorMessage about syntax 'c:\\x07emp'

or something that shouts out, "hey! one character in this location!" would be a good thing.

\--
\~Ethan\~


\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org




--
--Guido van Rossum (python.org/\~guido)