]> granicus.if.org Git - python/commit
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2290)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 20 Jun 2017 13:33:35 +0000 (15:33 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Jun 2017 13:33:35 +0000 (15:33 +0200)
commit4899d847ed3f56b2a712799f896aa1f28540a5c0
tree0eb18aeb2db152285f2a210a8de3161415245e2b
parent070ba85a8f45819d9197bce4541cd594d79d247c
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2290)

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