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 belopolsky
Recipients alexandre.vassalotti, belopolsky, lemburg, pitrou
Date 2010-06-28.02:11:10
SpamBayes Score 7.710109e-05
Marked as misclassified No
Message-id <1277691073.84.0.885848979642.issue5180@psf.upfronthosting.co.za>
In-reply-to
Content
The remaining bug is a bit harder.  If you try to run unpickle-bug-2.py on the same pickle, you get

$ python3 unpickle-bug-2.py /tmp/bug.pkl 
<__main__.Bug object at 0x1006a8f40>
Traceback (most recent call last):
  File "unpickle-bug-2.py", line 9, in <module>
    bug = pickle.Unpickler(open(sys.argv[1], 'rb')).load() # doesn't
TypeError: ('__init__() takes exactly 2 arguments (1 given)', <class '__main__.Bug'>, ())


The problem is acknowledged in the source code of instantiate function in _pickle.c:

    /* XXX: The pickle.py module does not create instances this way when the                                             
       args tuple is empty. See Unpickler._instantiate(). */
 

Clearly, this is wrong because pickle.py way succeeds where _pickle does not.


PS: I did not mean to unassign MAL, but I think this is more of alexandre.vassalotti's issue.
History
Date User Action Args
2010-06-28 02:11:13belopolskysetrecipients: + belopolsky, lemburg, pitrou, alexandre.vassalotti
2010-06-28 02:11:13belopolskysetmessageid: <1277691073.84.0.885848979642.issue5180@psf.upfronthosting.co.za>
2010-06-28 02:11:11belopolskylinkissue5180 messages
2010-06-28 02:11:11belopolskycreate