[ python-Bugs-1491688 ] Pickle & schizofrenic classes don't match

SourceForge.net noreply at sourceforge.net
Fri May 19 18:24:18 CEST 2006


Bugs item #1491688, was opened at 2006-05-19 17:51
Message generated for change (Comment added) made by ronaldoussoren
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1491688&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: Extension Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Ronald Oussoren (ronaldoussoren)
Assigned to: Nobody/Anonymous (nobody)
Summary: Pickle & schizofrenic classes don't match

Initial Comment:
The attached scripts causes infinite recursion on the C level resulting in a 
crash.

The script defines a subclass of object that throws an exception in its 
__reduce__ method.

This method is then uses as the value of a slot on a subclass of float. This 
subclass also defines a __class__ property that returns the __class__ of the 
value in its sole slot.

Finally an instance of the subclass of float is pickled. This results in 
infinite recursion. The problem goes away when __reduce__ doesn't raise 
an exception or when the __class__ property is removed.



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

>Comment By: Ronald Oussoren (ronaldoussoren)
Date: 2006-05-19 18:24

Message:
Logged In: YES 
user_id=580910

I forgot to mention that this patch is present in 2.3.5 upto the current SVN head.

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

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


More information about the Python-bugs-list mailing list