mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #20059: urllib.parse raises ValueError on all invalid ports.
Patch by Martin Panter.
This commit is contained in:
parent
846a1487cb
commit
dfa95c9a8f
5 changed files with 39 additions and 26 deletions
|
@ -156,9 +156,8 @@ class _NetlocResultMixinBase(object):
|
|||
port = self._hostinfo[1]
|
||||
if port is not None:
|
||||
port = int(port, 10)
|
||||
# Return None on an illegal port
|
||||
if not ( 0 <= port <= 65535):
|
||||
return None
|
||||
raise ValueError("Port out of range 0-65535")
|
||||
return port
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue