8000 gh-111140: Fix edge case in PyLong_AsNativeBytes where large negative longs may require an extra byte by zooba · Pull Request #116053 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111140: Fix edge case in PyLong_AsNativeBytes where large negative longs may require an extra byte #116053

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

Merged
merged 19 commits into from
Apr 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix for x86
  • Loading branch information
zooba committed Mar 4, 2024
commit 15b3752c8d5cf49fc103260e877cc8afbffb3c28
2 changes: 1 addition & 1 deletion Lib/test/test_capi/test_long.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def test_long_asnativebytes(self):
(255, b'\xff', 2),
(255, b'\x00\xff', 2),
(256, b'\x01\x00', 2),
(0x80, b'\x00' * 7 + b'\x80', 8),
(0x80, b'\x00' * 7 + b'\x80', min(8, SZ)),
# Extracts successfully (unsigned), but requests 9 bytes
(2**63, b'\x80' + b'\x00' * 7, 9),
(2**63, b'\x00\x80' + b'\x00' * 7, 9),
Expand Down
0