From 8ad33f7a11bd7b51168986dd05f64371c8249e0c Mon Sep 17 00:00:00 2001 From: Justin Applegate <70449145+Legoclones@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:28:28 -0500 Subject: [PATCH 1/2] Remove check for items on stack --- Lib/pickletools.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/pickletools.py b/Lib/pickletools.py index c462d26da97ce1..45bfab2ca6ef5e 100644 --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -2539,8 +2539,6 @@ def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0): stack.extend(after) print("highest protocol among opcodes =", maxproto, file=out) - if stack: - raise ValueError("stack not empty after STOP: %r" % stack) # For use in the doctest, simply as an example of a class to pickle. class _Example: From cfe06d848295b9c68db1f9dc32fc140ce807ca08 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:30:56 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2024-11-20-22-30-55.gh-issue-127079.egXnLz.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2024-11-20-22-30-55.gh-issue-127079.egXnLz.rst diff --git a/Misc/NEWS.d/next/Library/2024-11-20-22-30-55.gh-issue-127079.egXnLz.rst b/Misc/NEWS.d/next/Library/2024-11-20-22-30-55.gh-issue-127079.egXnLz.rst new file mode 100644 index 00000000000000..bed241198818a2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-11-20-22-30-55.gh-issue-127079.egXnLz.rst @@ -0,0 +1 @@ +:mod:`pickletools` no longer errors out when more than one item is left in the stack upon reaching the `STOP` opcode