On Tue, Feb 24, 2015 at 10:00 AM, Ethan Furman <et...@stoneleaf.us> wrote:

> On 02/24/2015 09:44 AM, Guido van Rossum wrote:
> >
> > TBH I think this will be a tough sell. I worry that an meme will emerge
> to make all
> > string literals use raw mode, or worse, to deprecate non-raw string
> literals. I'm
> > not sure how we'll get out of the whole conundrum, and I'm not in a
> hurry to see
> > this in 3.5.
>
> So should we move forward with just the better error messages?  It's a
> good first step, and even if it ends up being the
> only step it would be a huge improvement.
>

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.

And I'd weigh the needs of users who know what they are doing somewhat
higher than educating newbies through error messages. While newbies are
most likely to try out open() with a string literal, in "real" programs
that is rare, and filenames are typically taken from the command line or
from some other source where the peculiarities of Python string literals
are irrelevant.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
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/archive%40mail-archive.com

Reply via email to