Message391537
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. |
|
Date |
User |
Action |
Args |
2021-04-21 18:08:15 | Carl.Friedrich.Bolz | set | recipients:
+ Carl.Friedrich.Bolz |
2021-04-21 18:08:15 | Carl.Friedrich.Bolz | set | messageid: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org> |
2021-04-21 18:08:15 | Carl.Friedrich.Bolz | link | issue43907 messages |
2021-04-21 18:08:15 | Carl.Friedrich.Bolz | create | |
|