]> granicus.if.org Git - python/commit
urllib: Simplify splithost by calling into urlparse. (#1849)
authorpostmasters <namnguyen@google.com>
Tue, 20 Jun 2017 13:02:44 +0000 (06:02 -0700)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 20 Jun 2017 13:02:44 +0000 (15:02 +0200)
commit90e01e50ef8a9e6c91f30d965563c378a4ad26de
treee467f98aa737fb5c517df080f25d7734d81a5d55
parent5cc7ac24da10568d2a910a91a24183b904118cf8
urllib: Simplify splithost by calling into urlparse. (#1849)

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``.
Lib/test/test_urlparse.py
Lib/urllib/parse.py
Misc/ACKS
Misc/NEWS