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
raiseValueError("stack not empty after STOP: %r"%stack)
However, both C and Python versions of the Unpickler don't make these checks and don't care how many items are left on the stack afterwards, as long as there's something for them to return.
In addition, C and Python versions of pickle don't care if a MARK opcode is still present or it's inside a metastack or whatnot, but since pickletools treats MARK as an object on the stack, it will also error out if a pickled bytestream like b'(K\x01.' is presented:
pickletools:
0: ( MARK
1: K BININT1 1
3: . STOP
highest protocol among opcodes = 1
pickletools failed stack not empty after STOP: [mark]
Bug report
Bug description:
When the
STOP
opcode is encountered in pickletools, a check is made to see if there's anything left on the stack, and an error is thrown if there is.cpython/Lib/pickletools.py
Lines 2542 to 2543 in 5414b97
However, both C and Python versions of the Unpickler don't make these checks and don't care how many items are left on the stack afterwards, as long as there's something for them to return.
In addition, C and Python versions of pickle don't care if a
MARK
opcode is still present or it's inside a metastack or whatnot, but since pickletools treatsMARK
as an object on the stack, it will also error out if a pickled bytestream likeb'(K\x01.'
is presented:CPython versions tested on:
3.11
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: