Skip to content

Python 3.7.6 urllib.parse changes break gabbi tests #277

@cdent

Description

@cdent

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions