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 Carl.Friedrich.Bolz
Recipients Carl.Friedrich.Bolz
Date 2021-04-21.18:08:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org>
In-reply-to
Content
The new codepath for the BYTEARRAY8 bytecode is missing memoization:

>>> import pickletools, pickle
>>> b = (bytearray(b"abc"), ) * 2
>>> b1, b2 = pickle.loads(pickle.dumps(b, 5)) # C version
>>> b1 is b2
True
(bytearray(b'abc'), bytearray(b'abc'))
>>> b1, b2 = pickle.loads(pickle._dumps(b, 5)) # python version
>>> b1 is b2 # :-(
False

Found it because PyPy is using pickle.py with no C implementation. I'm preparing a patch.
History
Date User Action Args
2021-04-21 18:08:15Carl.Friedrich.Bolzsetrecipients: + Carl.Friedrich.Bolz
2021-04-21 18:08:15Carl.Friedrich.Bolzsetmessageid: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org>
2021-04-21 18:08:15Carl.Friedrich.Bolzlinkissue43907 messages
2021-04-21 18:08:15Carl.Friedrich.Bolzcreate