gruns / gruns/furl

'127.0.0.1:8329' parsed wrong in Python 3.9+

Open
#155 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
165
PR merge metrics
No merged PRs in 30d

Description

```python
Python 3.9.13 (main, Jun 19 2022, 13:12:56)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import furl
>>> furl.furl('127.0.0.1:8329').url
'8329'
>>> from six.moves import urllib
>>> urllib.parse.urlsplit('127.0.0.1:8329')
SplitResult(scheme='127.0.0.1', netloc='', path='8329', query='', fragment='')
```

```python
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import furl
>>> furl.furl('127.0.0.1:8329').url
'127.0.0.1:8329'
>>> from six.moves import urllib
>>> urllib.parse.urlsplit('127.0.0.1:8329')
SplitResult(scheme='', netloc='', path='127.0.0.1:8329', query='', fragment='')
```

This is due to a fix that was done on Python3.9 (https://github.com/python/cpython/issues/71844) that changed the `scheme` field in case no `scheme` is provided.

This fix also broke **requests** behavior and they had to replace their parsing method, with `urllib3` (https://github.com/psf/requests/pull/5917).

I suggest to fix this issue with `urllib3` too

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.