[Patches] [ python-Patches-409864 ] lazy fix for Pings bizarre scoping crash

noreply@sourceforge.net noreply@sourceforge.net
Wed, 21 Mar 2001 08:50:44 -0800


Patches item #409864, was updated on 2001-03-19 15:11
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=409864&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
>Priority: 7
Submitted By: Michael Hudson (mwh)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: lazy fix for Pings bizarre scoping crash

Initial Comment:
This is a minimal effort fix for Ping's report of a
crash on python-dev.

I don't know the new compile.c well enough to really
judge the best fix.

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

>Comment By: Jeremy Hylton (jhylton)
Date: 2001-03-21 08:50

Message:
Logged In: YES 
user_id=31392

This is a policy question I'm not comfortable answering. 
Should we allow dict modification during a PyDict_Next()
iteration if the number of keys remains the same?

I can make the compiler work with or without this change.


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

Comment By: Michael Hudson (mwh)
Date: 2001-03-21 08:35

Message:
Logged In: YES 
user_id=6656

last one for now; this patch adds a test to
Modules/_testcapimodule.c to ensure that assigning to the
keys you're iterating over works as advertised in the patch
to the documentation.  i've checked that it finds this case
(i.e. the test fails before my patch and passes after).

the _testcapi tests aren't actually run anywhere, are they?

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

Comment By: Michael Hudson (mwh)
Date: 2001-03-21 08:11

Message:
Logged In: YES 
user_id=6656

add ping's test case to Lib/test/test_scope.py
(I'll stop this soon).

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

Comment By: Michael Hudson (mwh)
Date: 2001-03-21 08:07

Message:
Logged In: YES 
user_id=6656

and documents that you can assign to the keys as you iterate
over them.

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

Comment By: Michael Hudson (mwh)
Date: 2001-03-21 08:05

Message:
Logged In: YES 
user_id=6656

this alternative approach patches PyDict_Next to check for
resize.

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

Comment By: Michael Hudson (mwh)
Date: 2001-03-19 15:12

Message:
Logged In: YES 
user_id=6656

remember the file!

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

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