[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

I guess I'll work around this, thanks.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Martin Panter


Martin Panter  added the comment:

I suspect this comes from Issue 27657. Consider how similar URLs like tel:123 
or javascript:123 should be parsed.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Arcadiy Ivanov


Change by Arcadiy Ivanov :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Arcadiy Ivanov


New submission from Arcadiy Ivanov :

$ ~/.pyenv/versions/3.8.6/bin/python3.8
Python 3.8.6 (default, Oct  8 2020, 13:32:06) 
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> urlparse("host:123", "http")
ParseResult(scheme='http', netloc='', path='host:123', params='', query='', 
fragment='')
>>> 

$ ~/.pyenv/versions/3.8.9/bin/python3.8
Python 3.8.9 (default, May  1 2021, 23:27:11) 
[GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> urlparse("host:123", "http")
ParseResult(scheme='http', netloc='', path='host:123', params='', query='', 
fragment='')
>>> 

$ ~/.pyenv/versions/3.9.4/bin/python3.9
Python 3.9.4 (default, Apr  8 2021, 17:27:49) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> urlparse("host:123", "http")
ParseResult(scheme='host', netloc='', path='123', params='', query='', 
fragment='')
>>> 


While I'm not sure, it seems to me that 3.9 is wrong here, given that the 
default scheme is specified as a second parameter to URL parse, i.e. "host:123" 
should be treated as "http://host:123; as in 3.8.

We also relied on this parser behavior, i.e. for us it's a regression.

--
components: Library (Lib)
messages: 392654
nosy: arcivanov
priority: normal
severity: normal
status: open
title: urlparse("host:123", "http") inconsistent between 3.8 and 3.9
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com