[Python-3000] Invalid \U escape in source code give hard-to-trace error (original) (raw)

Guido van Rossum guido at python.org
Mon Jul 16 22:35:12 CEST 2007


Doesn't look like it's the same problem. I've assigned that one to Martin who knows that area best of all.

On 7/15/07, Neal Norwitz <nnorwitz at gmail.com> wrote:

On 7/15/07, Guido van Rossum <guido at python.org> wrote: > When a source file contains a string literal with an out-of-range \U > escape (e.g. "\U12345678"), instead of a syntax error pointing to the > offending literal, I get this, without any indication of the file or > line: > > UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in > position 0-9: illegal Unicode character > > This is quite hard to track down. (Both the location of the bad > literal in the source file, and the origin of the error in the parser. > :-) Can someone come up with a fix?

Take a look at the patch http://python.org/sf/1031213 That might help. I'm not sure if it's the same problem. I really need to dispose of a bunch of things assigned to me. :-( n

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-3000 mailing list