Patches item #1591996, was opened at 2006-11-07 14:32
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1591996&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 6
Private: No
Submitted By: Hirokazu Yamamoto (ocean-city)
Assigned to: Martin v. Löwis (loewis)
Summary: `in` for classic object causes segfault

Initial Comment:
This code causes segfault.

class Foo: pass
foo = Foo()
1 in foo

E:\python-dev>py a.py
Exception exceptions.TypeError: "argument of type
'instance' is not iterable" in
 'garbage collection' ignored
Fatal Python error: unexpected exception during garbage
collection

This bug seems to be introduced by revision 45644
change for Objects/classobject.c
# -1 (error) is converted to 0 (False)

I think this can be fixed by attached patch. Thank you.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2006-11-08 07:47

Message:
Logged In: YES 
user_id=21627

I agree with Neal's patch, committed as r52662 and r52663.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-11-08 07:28

Message:
Logged In: YES 
user_id=33168

I fixed the problem slightly differently without casting,
but rather checking the result.  The patch also contains a
test case.

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

Comment By: Georg Brandl (gbrandl)
Date: 2006-11-07 16:39

Message:
Logged In: YES 
user_id=849994

Attaching to Martin since the mentioned revision is his.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1591996&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches

Reply via email to