[Patches] [ python-Patches-500002 ] Fix for #221791 (bad \x escape)

noreply@sourceforge.net noreply@sourceforge.net
Sun, 03 Mar 2002 13:33:59 -0800


Patches item #500002, was opened at 2002-01-06 01:45
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=500002&group_id=5470

Category: Core (C code)
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Martin v. Löwis (loewis)
Summary: Fix for  #221791 (bad \x escape)

Initial Comment:
This patch adds file and line output if a bad \x escape
was found in the source. It does so with the following
modifications:

- PyErr_Display now recognizes syntax errors not by
their class, but by an attribute print_file_and_line
- this attribute is set for all SyntaxError instances
- PyErr_SyntaxLocation is enhanced to set all attributes
expected for a syntax error, even if the current
exception has a different class.
- compile.c now invokes PyErr_SyntaxLocation for all
non-syntax exceptions also, mostly through com_error.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-03-03 22:33

Message:
Logged In: YES 
user_id=21627

Both asserts in this place where non-sensical left-overs
from an earlier version, and are now removed.

Committed as

NEWS 1.360          1.337.2.4.2.2
compile.c 2.239     2.234.4.3
errors.c 2.67       2.66.10.1
exceptions.c 1.29   1.28.6.1
pythonrun.c 2.155   2.153.6.2




----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-02 00:00

Message:
Logged In: YES 
user_id=6380

If the pydebug problem can be fixed, I'd be all for
implementing it, and adding to 2.2.1.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-01-30 16:01

Message:
Logged In: YES 
user_id=6656

This doesn't compile --with-pydebug (he suddenly notices).

There's an assert(val == NULL) in compile.c, but no variable
val.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=500002&group_id=5470