homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nobody
Recipients
Date 2001年11月18日.06:56:48
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: NO 
Barry - the new docs just went up and they're a big
improvement over the old. However the sentence 
"The issue here is usually not that a class's constructor
will get called -- it won't by the unpickler -- but that the
class's destructor (i.e. its __del__() method) might get
called when the object is garbage collected." isn't
correct. 
There's a flag in the pickle stream that tells
the unpickler that the pickler found a __getinitargs__
method at pickling time. If the flag is set in the pickle,
then the unpickler calls the class constructor, whether
there's a __getinitargs__ method in the class or not.
The sample exploit that I posted earlier on,
<http://www.nightsong.com/phr/python/pickletest.py>,
is an example of an artificially concocted pickle that
makes a class constructor get called.
History
Date User Action Args
2007年08月23日 13:56:49adminlinkissue471893 messages
2007年08月23日 13:56:49admincreate

AltStyle によって変換されたページ (->オリジナル) /