This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author maggyero
Recipients Jeremy.Hylton, maggyero, nicktimko, orsenthil
Date 2019-09-02.22:43:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567464204.95.0.554990512068.issue37969@roundup.psfhosted.org>
In-reply-to
Content
@nicktimko Thanks for the historical track.

Here is a patch that solves this issue by updating the `urlsplit` and `urlunsplit` functions of the `urllib.parse` module to keep the '?' and '#' delimiters in URIs if present, even if their associated component is empty, as required by RFC 3986: https://github.com/python/cpython/pull/15642

That way we get the correct behavior:

    >>> import urllib.parse
    >>> urllib.parse.urlunsplit(urllib.parse.urlsplit("http://example.com/?"))
    'http://example.com/?'
    >>> urllib.parse.urlunsplit(urllib.parse.urlsplit("http://example.com/#"))
    'http://example.com/#'

Any feedback welcome.
History
Date User Action Args
2019-09-02 22:43:25maggyerosetrecipients: + maggyero, orsenthil, Jeremy.Hylton, nicktimko
2019-09-02 22:43:24maggyerosetmessageid: <1567464204.95.0.554990512068.issue37969@roundup.psfhosted.org>
2019-09-02 22:43:24maggyerolinkissue37969 messages
2019-09-02 22:43:24maggyerocreate