Message108815
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. |
|
Date |
User |
Action |
Args |
2010-06-28 02:11:13 | belopolsky | set | recipients:
+ belopolsky, lemburg, pitrou, alexandre.vassalotti |
2010-06-28 02:11:13 | belopolsky | set | messageid: <1277691073.84.0.885848979642.issue5180@psf.upfronthosting.co.za> |
2010-06-28 02:11:11 | belopolsky | link | issue5180 messages |
2010-06-28 02:11:11 | belopolsky | create | |
|