Repository navigation
fix(ipv4): build the TS option from its default timestamp, and print a bad one with !r (#2277) - #2347
Merged
Merged
Conversation
Owner
Author
|
Review: NEEDS CHANGES at
|
…a bad one with !r (#2277) Problem: _make_opt_ts accepted only a list or a dict for timestamp, but its default is None, so a TS option made without timestamps always raised ProtocolError; the error printed the value without !r. Fix: treat None as an empty list before the type dispatch, so it builds a Timestamp-only option with `counts` empty slots; any other non-list, non-dict raises "invalid timestamp value: must be a list or a dict, not <repr>". The docstring's Raises names ProtocolError for exactly that. Test: test_ipv4_ts_default_unit pins the default option make -> parse -> rebuild byte for byte and the message text; test_ipv4_unit's timestamp=None ProtocolError case now uses 'abc'.
JarryShaw
force-pushed
the
fix/2277-ipv4-ts-default
branch
from
October 27, 2026 02:09
cd3ec38 to
5e27d30
Compare
Owner
Author
|
Amended |
Contributor
|
Coverage: 91.58% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
|
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix — bug fixDescription
Closes #2277.
IPv4._make_opt_tsnow treats an omitted orNonetimestamp as an empty list, giving a Timestamp-only option with no slots, instead of raising on its own default. Any other bad value raises with the house-form message and!r.origin/main. Passing on the rebased head.