Skip to content
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

Python 3.7.6 urllib.parse changes break gabbi tests #277

Closed
cdent opened this issue Jan 17, 2020 · 1 comment · Fixed by #292
Closed

Python 3.7.6 urllib.parse changes break gabbi tests #277

cdent opened this issue Jan 17, 2020 · 1 comment · Fixed by #292

Comments

@cdent
Copy link
Owner

cdent commented Jan 17, 2020

Python 3.7.6 was released with a change to how urllib.parse will deal with "localhost:80".

3.7.5:

>>> from urllib import parse
>>> parse.urlparse("foobar.com:999")
ParseResult(scheme='', netloc='', path='foobar.com:999', params='', query='', fragment='')

3.7.6

>>> from urllib import parse
>>> parse.urlparse("foobar.com:999")
ParseResult(scheme='foobar.com', netloc='', path='999', params='', query='', fragment='')

See this bug: https://bugs.python.org/issue27657 and a related pull request: python/cpython#16839

This breaks gabbi.utils:host_info_from_target. It also apparently break a whole ton of other software out there in the world. This a) seems like the wrong fix, b) if it is indeed correct, is bad for a minor release.

Since gabbi only talks http, it can probably be fixed by branch on whether the target starts with http but some discussion is probably worth having before going down that route.

@cdent
Copy link
Owner Author

cdent commented Dec 16, 2020

This reactivated for python 3.9 so will need a real fix.

cdent added a commit that referenced this issue Dec 19, 2020
The modern urlparse has changed behavior for parsing
url-like strings that do not have a scheme. Initially
this was added in python 3.7.x but there were issues
with backwards compatibility. It came back with python
3.9.

The fix here addresses the problem by always adding
a scheme if one is not present. Existing styles of
telling gabbi where to go with requests continue
to work.

Python 3.9 is added to the testing configurations.

Fixes #277
cdent added a commit that referenced this issue Dec 19, 2020
The modern urlparse has changed behavior for parsing
url-like strings that do not have a scheme. Initially
this was added in python 3.7.x but there were issues
with backwards compatibility. It came back with python
3.9.

The fix here addresses the problem by always adding
a scheme if one is not present. Existing styles of
telling gabbi where to go with requests continue
to work.

Python 3.9 is added to the testing configurations.

Fixes #277
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant