You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
urllib2/urllib.parse.splitport does not handle IPv6 correctly #62391
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2013-06-11.14:44:39.479>labels= ['type-bug', 'library']
title='urllib2/urllib.parse.splitport does not handle IPv6 correctly'updated_at=<Date2014-03-07.16:23:13.722>user='https://github.com/jd'
I posted a patch to bpo-20271 which should fix the issue. I wrote the patch for Python 3.5, but it can be adapted to be tolerant (don't make extensive tests on port number, host and IPv6) for older versions.
Activity
jd commentedon Jun 11, 2013
This is obviously invalid.
jd commentedon Jun 12, 2013
Attached is a patch inspired by a function written for OpenStack Oslo library.
dhellmann commentedon Jun 12, 2013
LGTM
serhiy-storchaka commentedon Jun 12, 2013
I see only tests.
It is more common to use arguments for assertEqual() in the reverse order, first actual value, and than expected value.
berkerpeksag commentedon Jun 12, 2013
FTR, urllib.parse.splitport is undocumented and it is only used by urllib.request in the stdlib.
samwyse commentedon Jul 22, 2013
Fixes Serhiy Storchaka's complaints, removes duplicate test.
samwyse commentedon Jul 22, 2013
Handles "raw" IPv6 URLs
serhiy-storchaka commentedon Jan 15, 2014
Julien's patch is subject to bugs described in bpo-20270 and bpo-20271. As far as OpenStack Oslo library.
vstinner commentedon Mar 7, 2014
I posted a patch to bpo-20271 which should fix the issue. I wrote the patch for Python 3.5, but it can be adapted to be tolerant (don't make extensive tests on port number, host and IPv6) for older versions.
serhiy-storchaka commentedon Aug 20, 2024
splitport()was deprecated in 3.8.picnixz commentedon Dec 2, 2024
Closing as
not plannedsince the function is now private-only and deprecated.