[Python-bugs-list] [ python-Bugs-221791 ] Error for bad \x escape doesn't mention filename
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 18 Jan 2002 14:38:49 -0800
Bugs item #221791, was opened at 2000-11-06 08:34
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470
Category: Parser/Compiler
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error for bad \x escape doesn't mention filename
Initial Comment:
Using:
GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
I get the following 'error' message:
from interscript.languages.interscript_languages import add_translation
File "interscript/languages/interscript_languages.py", line 2, in ?
from interscript.encoding.utf8 import utf8
ValueError: invalid \x escape
in known correct code (i.e. it works on Python 1.5.2).
I have examined the function 'parsestr' in
'compile.c', and added debugging prints to find out
what is going on. The function _correctly_ processes
the string 'utf8' (quotes included), and returns,
then the error is generated _without_ entering
the routine!
This almost certainly must be a bug in egcs-2.91.66.
The code in 'parsestr' looks correct to me.
It is possible the error can be replicated by
downloading and running 'interscript' (without
any arguments). Interscript is available at
http://interscript.sourceforge.net
[Reply to skaller@maxtal.com.au, sorry, I couldn't
figure out how to 'log on']
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-01-18 14:38
Message:
Logged In: YES
user_id=21627
A patch is available at
https://sourceforge.net/tracker/?func=detail&aid=500002&group_id=5470&atid=305470
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2001-09-05 12:29
Message:
Logged In: YES
user_id=31435
A kick in the butt won't help. It has a higher
effort/payback ratio than anything else on my plate, and so
long as that's true it stays at the bottom of my priority
list. If someone else wants to tackle it, great.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-05 11:20
Message:
Logged In: YES
user_id=6380
This one can use a kick in the butt -- it's still unsolved!
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2000-12-13 08:56
Message:
I lost my changes when moving to my new machine. Wasn't happy with them anyway -- changing the exception from ValueError to SyntaxError was purely a hack, to worm its way thru the maze of hacks already there. As long as it's got to be a hack, better a pleasant hack <wink>.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2000-12-13 08:02
Message:
Tim, I remember you were looking into this. Any luck?
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2000-11-13 14:51
Message:
Just noting that this is a bit of a mess to repair: no "2nd phase" compile-time errors report file names or line numbers unless they're SyntaxErrors. The bad \x escape here is one path thru that code; bad \x escapes in Unicode strings are another; likewise for OverflowError due to "too large" integer literal. A fix is in progress.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2000-11-06 09:04
Message:
The error message is legitimate: in Python 2.0, \x escapes must have exactly two hex characters following, and he uses \x0\x0 in his __init__.py module, which generates the error message.
But his bug report is also legitimate: the ValueError doesn't mention the file where this is occurring! I'm changing the bug subject to reflect this -- it has nothing to do with egcs 2.91.66.
I'm randomly assigning this to Tim.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=221791&group_id=5470