New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urllib.splithost parses incorrectly #43078
Comments
urllib.splithost(url) requires that the url passed in Section 3.2 of rfc2396 (Uniform Resource Identifiers: Also, this is how it defines a URI: absoluteURI = scheme ":" ( hier_part | opaque_part )
hier_part = ( net_path | abs_path ) [ "?" query ]
net_path = "//" authority [ abs_path ]
abs_path = "/" path_segments Based on the above, you could certainly have: In python2.3 you would just need to change line 939 in _hostprog = re.compile('^//([^/]*)(.*)$') to: _hostprog = re.compile('^//([^/?]*)(.*)$') This appears to affect all python versions, I just |
Logged In: YES The problem I was having specifically was that the url had a import urllib2
webpage = urllib2.urlopen("http://host.com?a=b:3b") You will then get a "httplib.InvalidURL: nonnumeric port: '3b'" |
Logged In: YES Fixed in rev. 43330. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: