Repository navigation
fix(sctp): check parameter types in the Supported Address Types and Missing Mandatory Parameter makers (#2288) - #2363
Merged
Conversation
Owner
Author
|
Review: NEEDS CHANGES at
|
…issing Mandatory Parameter makers (#2288) SCTP._make_param_addrtypes and _make_cause_missing_param shared the conversion "Enum_Parameter.get(item) if isinstance(item, int) else item": True became parameter type 1, False raised EnumValueError, and a str or float item was stored unchecked. Both makers now call one helper, _make_param_types, which raises ProtocolError "SCTP: invalid parameter type: ..." for a bool or any item that is neither a Parameter nor an int. The helper is documented in sctp.rst, since both makers' docstrings refer to it. Test: test_parameter_type_lists_refuse_a_bool_and_a_non_int pins the message for True, False, '5', 5.0 and None in both makers.
JarryShaw
force-pushed
the
fix/2288-sctp-param-type-bool-str
branch
from
October 27, 2026 04:24
5936220 to
0ca99b0
Compare
Owner
Author
|
Amended |
Owner
Author
|
Ready to merge at
|
Contributor
|
Coverage: 91.58% (unit tier, Python 3.15,
Per-file detail: the |
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 #2288.
SCTP._make_param_typeshelper backs both the Supported Address Types and Missing Mandatory Parameter makers, and raisesProtocolErrorfor aboolor anything that is neither aParameternor anint.origin/main. Passing on the rebased head.