-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-135241: Changed the opcode of _pickle module to look for 00 and 01 specifically #135242
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
Changes from 4 commits
21ff211
6ccd46e
39fc1dd
74ad541
b01541c
005f2f2
3ce9a51
dbf9ffb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -376,6 +376,16 @@ class CUnpicklerTests(PyUnpicklerTests): | |
| bad_stack_errors = (pickle.UnpicklingError,) | ||
| truncated_errors = (pickle.UnpicklingError,) | ||
|
|
||
| def test_issue135241(self): | ||
| # C implementation should check for hardcoded values 00 and 01 | ||
| # when getting booleans from the INT opcode. Doing a str comparison | ||
| # to bypass truthy/falsy comparisons. These payloads should return | ||
| # 0, not False. | ||
| out1 = self.loads(b'I+0\n.') | ||
|
||
| self.assertTrue(str(out1) == str(0)) | ||
| out2 = self.loads(b'I 0\n.') | ||
| self.assertTrue(str(out2) == str(0)) | ||
|
|
||
| class CPicklingErrorTests(PyPicklingErrorTests): | ||
| pickler = _pickle.Pickler | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| The :code:`INT` opcode of the C accelerator ``_pickle`` module was updated to look only for "00" and "01" to push booleans onto the stack, aligning with the Python :mod:`pickle` module. | ||
Legoclones marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.