[Python-bugs-list] [ python-Bugs-409230 ] Python 2.1b1 dumps core on list compr.

noreply@sourceforge.net noreply@sourceforge.net
Sun, 18 Mar 2001 03:15:59 -0800


Bugs item #409230, was updated on 2001-03-16 14:01
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=409230&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Priority: 7
Submitted By: Viktor Ferenczi (complex)
Assigned to: Jeremy Hylton (jhylton)
Summary: Python 2.1b1 dumps core on list compr.

Initial Comment:
Hi!

Python 2.1b1 dumps core when executing the following
statement:

print [[y for y in [x,x+1]] for x in [1,3]]

(Should print: [[1,2],[3,4]])

The problem may be related to variable scope resolving
code, because python reports "unknown scope for _[2] in
?(0)" before dumping core. This bug makes impossible to
use a list comprehension as the expression field of
another one.


-Complex-

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

>Comment By: Moshe Zadka (moshez)
Date: 2001-03-18 03:15

Message:
Logged In: YES 
user_id=11645

Here is a patch to fix the problem.


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

Comment By: Michael Hudson (mwh)
Date: 2001-03-18 02:34

Message:
Logged In: YES 
user_id=6656

Well, no, it's not the same test case, but it is the same
problem.  It also doesn't crash if you apply patch #406076,
which I wrote to fix #406049.

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

Comment By: Tim Peters (tim_one)
Date: 2001-03-17 22:14

Message:
Logged In: YES 
user_id=31435

Assigned to Jeremy.  Boosted priority.  Note that mwh says 
this is a dup of 406049 (but this is clearly not the same 
test case).  Whatever, I confirmed that this specific case 
still crashes.

Fatal Python error: unknown scope for _[2] in ?(0) in 
<stdin>


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

Comment By: Michael Hudson (mwh)
Date: 2001-03-17 09:55

Message:
Logged In: YES 
user_id=6656

this is a dup of

[ #406049 ] crash on nested listcomps

so someone with appropriate privilege should mark it as such.


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

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