[issue43907] pickle.py bytearray memoization bug with protocol 5

2021-04-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Thanks for the report and fix!

--
components: +Library (Lib)
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43907] pickle.py bytearray memoization bug with protocol 5

2021-04-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 1e9f0933095403b215c2c4a0be7915d034ff7026 by Carl Friedrich 
Bolz-Tereick in branch 'master':
bpo-43907: add missing memoize call in pure python pickling of bytearray 
(GH-25501)
https://github.com/python/cpython/commit/1e9f0933095403b215c2c4a0be7915d034ff7026


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43907] pickle.py bytearray memoization bug with protocol 5

2021-04-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43907] pickle.py bytearray memoization bug with protocol 5

2021-04-21 Thread Carl Friedrich Bolz-Tereick


Change by Carl Friedrich Bolz-Tereick :


--
keywords: +patch
pull_requests: +24221
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25501

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43907] pickle.py bytearray memoization bug with protocol 5

2021-04-21 Thread Carl Friedrich Bolz-Tereick


New submission from Carl Friedrich Bolz-Tereick :

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.

--
messages: 391537
nosy: Carl.Friedrich.Bolz
priority: normal
severity: normal
status: open
title: pickle.py bytearray memoization bug with protocol 5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com