]> granicus.if.org Git - python/commit
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2289)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 20 Jun 2017 13:37:24 +0000 (15:37 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Jun 2017 13:37:24 +0000 (15:37 +0200)
commit536c1f1246f4faa302f9f5613fc3444e7ae09b4a
tree699718dbe3fa36c47e03dab75a8bfd68e2b5a6ff
parent0a4fe1d8578fa59004518f8deef137282be4d71a
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2289)

The current regex based splitting produces a wrong result. For example::

  http://abc#@def

Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)
Lib/test/test_urlparse.py
Lib/urllib/parse.py
Misc/ACKS
Misc/NEWS