You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assigning a dict to the memo of an Unpickler object fails #111066
When using the C accelerated implementation of the pickle module, assigning a dict to the memo of an Unpickler object leads to clearing the memo.
I think there is an error in Unpickler_set_memo as instructions at lines 7493 to 7495 (MemoCleanup and assignment of new_memo to self->memo) cancels the result of instruction at line 7482 (MemoPut).
Assigning a memo from an already used Unpickler object to a brand new one leads to an error ("memo value not found") when trying to use it to unpickle the same byte sequence. I suspect it is because memo_len of target is not set to memo_len from source, either by using _Unpickler_MemoPut after switching to the new blank memo rather than copying or by doing the assignment at the end of Unpickler_set_memo.
Activity
PCigales commentedon Oct 19, 2023
Assigning a memo from an already used Unpickler object to a brand new one leads to an error ("memo value not found") when trying to use it to unpickle the same byte sequence. I suspect it is because memo_len of target is not set to memo_len from source, either by using _Unpickler_MemoPut after switching to the new blank memo rather than copying or by doing the assignment at the end of Unpickler_set_memo.
pythongh-111066: Fix setting the memo of the C Unpickler
Merge branch 'main' into fix/pythongh-111066-unpickler-memo