]> 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)
committerNed Deily <nad@python.org>
Fri, 7 Jul 2017 03:27:01 +0000 (23:27 -0400)
commitb0fba8874a4bd6bf4773e6efdbd8fa762e9f05bd
treecd2d27fd23d8c2f188a05ba74b8c966884c385e6
parent00134f64d982561750f57f1a0bb7bb073f9f237c
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)
(cherry picked from commit 536c1f1246f4faa302f9f5613fc3444e7ae09b4a)
Lib/test/test_urlparse.py
Lib/urllib/parse.py
Misc/ACKS
Misc/NEWS