[Checkins] [zopefoundation/zope.publisher] 147b96: Avoid using urllib.parse.splitport()

Marius Gedminas noreply at github.com
Thu Aug 8 12:36:15 CEST 2019


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.publisher
  Commit: 147b96ad430a21b1d926b35573e09a4d3e4f0965
      https://github.com/zopefoundation/zope.publisher/commit/147b96ad430a21b1d926b35573e09a4d3e4f0965
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-08-07 (Wed, 07 Aug 2019)

  Changed paths:
    M src/zope/publisher/http.py
    M src/zope/publisher/tests/test_http.py

  Log Message:
  -----------
  Avoid using urllib.parse.splitport()

The function is an undocumented internal helper and emits a deprecation
warning in Python 3.8.

The suggested replacement is urllib.parse.urlparse(), but it's awkward
for our use case (you have to add a scheme so it doesn't treat the
argument as a relative URL, and it unwraps IPv6 addresses that we'd have
to wrap right back into [], and it converts the port to an int whereas
we expect it to be a string) so let's just reimplement the function
using a regexp (which is what the stdlib did anyway).

Fixes #38.


  Commit: 9795795d5ffcbc5d72a8b3e368035d5408827fc0
      https://github.com/zopefoundation/zope.publisher/commit/9795795d5ffcbc5d72a8b3e368035d5408827fc0
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-08-07 (Wed, 07 Aug 2019)

  Changed paths:
    M CHANGES.rst

  Log Message:
  -----------
  Update changelog


  Commit: dd8e040bb499882ae45b6a2668d30601a18f7add
      https://github.com/zopefoundation/zope.publisher/commit/dd8e040bb499882ae45b6a2668d30601a18f7add
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2019-08-08 (Thu, 08 Aug 2019)

  Changed paths:
    M CHANGES.rst
    M src/zope/publisher/http.py
    M src/zope/publisher/tests/test_http.py

  Log Message:
  -----------
  Merge pull request #48 from zopefoundation/fix-deprecation-warning-in-3.8

Avoid using urllib.parse.splitport()


Compare: https://github.com/zopefoundation/zope.publisher/compare/ac6435403aeb...dd8e040bb499


More information about the checkins mailing list