[Python-checkins] [python/cpython] d4324b: bpo-30500: urllib: Simplify splithost by calling i...

GitHub noreply at github.com
Tue Jun 20 10:20:38 EDT 2017


  Branch: refs/heads/2.7
  Home:   https://github.com/python/cpython
  Commit: d4324baca4c03eb8d55446cd1b74b32ec5633af5
      https://github.com/python/cpython/commit/d4324baca4c03eb8d55446cd1b74b32ec5633af5
  Author: Victor Stinner <victor.stinner at gmail.com>
  Date:   2017-06-20 (Tue, 20 Jun 2017)

  Changed paths:
    M Lib/test/test_urllib.py
    M Lib/urllib.py
    M Misc/ACKS
    M Misc/NEWS

  Log Message:
  -----------
  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)




More information about the Python-checkins mailing list