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

Add python3 compatability for gen_tzinfo.py and gen_tests.py #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cphang99
Copy link

This PR adds python3 compatibility for gen_tzinfo.py and gen_tests.py, whilst maintaining existing python2 support.

Some distributions (fedora) are planning to default /usr/bin/python to python3. Other base runtimes (freedesktop-sdk) plan to deprecate python2 completely, meaning that building pytz against this runtime will not be possible.

We add an additional command to the travis script, and enabling the PYTHON make variable to be user-configurable, to allow CI to test for python3 build compatibility.

Copy link
Owner

@stub42 stub42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but overkill. There is no reason to ensure that the gen_*.py scripts keep running under Python2. The .travis.yml can remain the same, and PYTHON=/usr/bin/python3 set in the Makefile. This also makes the __future__ imports unnecessary.

Chris Phang added 5 commits November 3, 2019 22:20
gen_tzinfo.py contains some python2 specific code, that is made
compatible with python3 as well.

In link() io.open is utilised so that the method of
dealing with decoding errors with binary data in tz/
is explicitly handled (and can be used in python2 and 3).
@cphang99
Copy link
Author

cphang99 commented Nov 3, 2019

@stub42 apologies for the v.long delay in getting updates to you. I've updated the branch to have only python3 compatability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants