[New-bugs-announce] [issue27657] urlparse fails if the path is numeric

Björn Lindqvist report at bugs.python.org
Sat Jul 30 15:57:17 EDT 2016


New submission from Björn Lindqvist:

This affects both Python 2 and 3. This is as expected:

>>> urlparse('abc:123.html')
ParseResult(scheme='abc', netloc='', path='123.html', params='', query='', fragment='')
>>> urlparse('123.html:abc')
ParseResult(scheme='123.html', netloc='', path='abc', params='', query='', fragment='')
>>> urlparse('abc:123/')
ParseResult(scheme='abc', netloc='', path='123/', params='', query='', fragment='')

This is NOT:

>>> urlparse('abc:123')
ParseResult(scheme='', netloc='', path='abc:123', params='', query='', fragment='')

Expected is path='123' and scheme='abc'. At least according to my reading of the rfc (https://tools.ietf.org/html/rfc1808.html) that is what should happen.

----------
components: Library (Lib)
messages: 271702
nosy: Björn.Lindqvist
priority: normal
severity: normal
status: open
title: urlparse fails if the path is numeric
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27657>
_______________________________________


More information about the New-bugs-announce mailing list