Skip to content

gh-123309: Remove check for redefined memo entry in pickletools.dis() #123374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 27, 2024

Such pickles are supported by the Unpickler even if the Pickler does not produce them.

….dis()

Such pickles are supported by the Unpickler even if the Pickler does not
produce them.
@serhiy-storchaka serhiy-storchaka force-pushed the pickletools-dis-check-redefined-memo branch from 6a09abf to 5f50e11 Compare August 31, 2024 09:35
@@ -2484,7 +2482,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
assert opcode.name == "POP"
numtopop = 0
else:
errormsg = markmsg = "no MARK exists on stack"
errormsg = "no MARK exists on stack"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this because:

  • this was the only case when the error message was also included in the output
  • all other comments in the output are enclosed in parentheses, so this one was outlier

@serhiy-storchaka serhiy-storchaka merged commit 5414b97 into python:main Aug 31, 2024
36 checks passed
@serhiy-storchaka serhiy-storchaka deleted the pickletools-dis-check-redefined-memo branch August 31, 2024 13:21
@birkenfeld
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants