Skip to content

Serialize ints below -2**31 through the long path; add serializer property tests - #444

Open
RonnyPfannschmidt wants to merge 5 commits into
mainfrom
claude/project-thread-p75clp
Open

RonnyPfannschmidt wants to merge 5 commits into
mainfrom
claude/project-thread-p75clp

Conversation

@RonnyPfannschmidt

@RonnyPfannschmidt RonnyPfannschmidt commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Requested by Ronny · project thread

🤖 Written by Claude Opus 5.5 via Claude Code for the execnet maintainers; I prompted it, it did the work, I read it.

_save_integral only checked the upper int32 bound, so execnet.dumps(-2**40) raised struct.error. Both bounds are now checked; the wire format is unchanged.

Tests: the copied per-type serializer tests become one expectation table, and a new hypothesis roundtrip test compares exact types (it shrinks to -2147483649 without the fix). The remote_exec module tests now load their files fresh instead of importing them; they relied on a stale sys.modules entry that pytest 9.2's new tmp_path numbering exposed.

🤖 Generated with Claude Code

https://claude.ai/code/session_014GZsRDQkuvszcFpTy6M5bE

…perty tests

_save_integral only checked the upper int32 bound, so ints below -2**31
reached struct.pack("!i") and raised a bare struct.error instead of
taking the LONGINT/LONGLONG path like large positive ints. Check both
bounds. The wire format is unchanged (load_longint parses the decimal
string, sign included), so older receivers read the output.

Tests:
- collapse the near-identical per-type cross-interpreter tests in
  test_serializer.py into one expectation table, adding int32 boundary
  and large negative rows
- add hypothesis roundtrip tests over nested builtin values, comparing
  exact types and float bit patterns; without the fix it shrinks to
  -2147483649

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GZsRDQkuvszcFpTy6M5bE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GZsRDQkuvszcFpTy6M5bE
test_remote_exec_module_is_removed imported `remote` from tmp_path and
then deleted the directory. The module stayed in sys.modules, so later
parametrizations got the stale module back. It only passed because pytest
before 9.2 reused the deleted tmp_path name, which made the stale
__file__ valid again. Since pytest 9.2 hands out a new number, later
cases fail with "could not get source code".

Load the files with importlib without registering them in sys.modules or
touching sys.path, assert the module's __file__ is this test's path, and
check the full path in the traceback test, which had the same latent
staleness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GZsRDQkuvszcFpTy6M5bE

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants