Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated splitport and splittype. #476

Merged
merged 7 commits into from Mar 11, 2019

Conversation

@icemac
Copy link
Member

commented Feb 8, 2019

Python 3.8 deprecates splitport and splittype, see
https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L1039-L1042
resp.
https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L969-L972

VirtualHostMonster.py imports splitport from HTTPRequest.
The new function is modelled after the requirements of its tests.

The default ports changed from str to int because urlparse returns int port
numbers.

Replace deprecated splitport and splittype.
Python 3.8 deprecates `splitport` and `splittype`, see
https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L1039-L1042
resp.
https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L969-L972

VirtualHostMonster.py imports `splitport` from `HTTPRequest`.
It is modelled after the requirements of its tests.

The default ports changed from str to int because `urlparse` returns int port
numbers.

@icemac icemac added the enhancement label Feb 8, 2019

@icemac icemac added this to the 4.0 final milestone Feb 8, 2019

@icemac icemac self-assigned this Feb 8, 2019

@icemac icemac added this to In progress in Zope 4 final release via automation Feb 8, 2019

@icemac icemac requested a review from dataflake Mar 8, 2019

else:
from cgi import escape
from urllib import splitport
from urllib import splittype
from urlparse import urlparse

This comment has been minimized.

Copy link
@dataflake

dataflake Mar 8, 2019

Member

You could also use from six.moves.urllib.parse import urlparse to get around the try/except, which isort ignores for import sorting.

@dataflake
Copy link
Member

left a comment

LGTM, just added one comment about maybe using six.moves.urllib.parse

Zope 4 final release automation moved this from In progress to Reviewer approved Mar 8, 2019

dataflake and others added some commits Mar 8, 2019

@dataflake dataflake merged commit 2da2c2c into master Mar 11, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.005%) to 80.872%
Details

Zope 4 final release automation moved this from Reviewer approved to Done Mar 11, 2019

@dataflake dataflake deleted the deprecated_splitport_splittype branch Mar 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.