classification
Title: port not split in function urllib.parse.urlsplit
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: JTMoon79, r.david.murray
Priority: normal Keywords:

Created on 2010-12-13 20:05 by JTMoon79, last changed 2010-12-13 20:21 by r.david.murray. This issue is now closed.

Messages (3)
msg123897 - (view) Author: JamesThomasMoon1979 (JTMoon79) Date: 2010-12-13 20:05
urlsplit function from urllib.parse.urlsplit does not return the port field.
Repro steps

>>> import urllib
>>> import urllib.parse
>>> urllib.parse.urlsplit(r'http://foo.bar.com:80/blarg?a=1&b=2')
RETURNS:
SplitResult(scheme='http', netloc='foo.bar.com:80', path='/blarg', query='a=1&b=2', fragment='')
EXPECTED:
SplitResult(scheme='http', netloc='foo.bar.com', path='/blarg', port='80', query='a=1&b=2', fragment='')
msg123899 - (view) Author: JamesThomasMoon1979 (JTMoon79) Date: 2010-12-13 20:18
see comments at http://bugs.python.org/issue10697#msg123898
msg123900 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-13 20:21
Take another look at the documentation.

http://docs.python.org/dev/library/urllib.parse.html

>>> import urllib.parse
>>> o = urllib.parse.urlsplit("http://foo.bar.com:80/blarg?a=1&b=2")
>>> o
SplitResult(scheme='http', netloc='foo.bar.com:80', path='/blarg', query='a=1&b=2', fragment='')
>>> o.port
80
History
Date User Action Args
2010-12-13 20:21:33r.david.murraysetstatus: open -> closed
2010-12-13 20:21:23r.david.murraysetnosy: + r.david.murray
messages: + msg123900

resolution: not a bug
stage: resolved
2010-12-13 20:18:46JTMoon79setmessages: + msg123899
2010-12-13 20:05:46JTMoon79create