Skip to content

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.

@cphang99 cphang99 force-pushed the cphang/py3-gen_tzinfo branch from b588490 to 86e04ee Compare December 23, 2018 20:34
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 cphang99 force-pushed the cphang/py3-gen_tzinfo branch from 86e04ee to dfbcc63 Compare November 3, 2019 22:39
@cphang99 cphang99 requested a review from stub42 November 3, 2019 22:41
@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