]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2294)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 20 Jun 2017 14:20:36 +0000 (16:20 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Jun 2017 14:20:36 +0000 (16:20 +0200)
commitd4324baca4c03eb8d55446cd1b74b32ec5633af5
tree4144e9fae2d0d6913340f9c0ff9c96612abd0f26
parentb39a7481ee7e6166d6d2b252a7a514b1f6553dfa
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2294)

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_urllib.py
Lib/urllib.py
Misc/ACKS
Misc/NEWS