◐ Shell
clean mode source ↗

gh-74895: getaddrinfo no longer raises OverflowError by smejkar · Pull Request #2435 · python/cpython

Convert a numeric port number to a string without an intermediate C long.
This prevents raising OverflowError if the port number is out of the
C long range.

MaxwellDupre

@arhadthedev arhadthedev changed the title bpo-30710: getaddrinfo raises OverflowError gh-74895: getaddrinfo raises OverflowError

Feb 13, 2023

@arhadthedev

@smejkar smejkar mannequin mentioned this pull request

Feb 13, 2023
Some systems treat it as unsigned internally so ULONG_MAX+1 is needed, not LONG_MAX+1.
Also updates our canned getaddrinfo.c implementation to actually
report an error for values outside of the u_short range it casts
the value to instead of ignoring them.

@gpshead gpshead changed the title gh-74895: getaddrinfo raises OverflowError gh-74895: getaddrinfo no longer raises OverflowError

Feb 14, 2023