Closed okin closed 6 years ago
@rfk in regard to the change of SYSTEMPYTHON
: until all dependencies support Python 3 I think it is better to prefer Python 2 in case anyone wants to run this on an OS which has both Python versions. Relevant to this is PEP 394 which also mentions some distributions breaking with this behaviour (notably Arch Linux).
What would be the best way to keep this available for future reference? I could add the code but leave it commented out in the Makefile so anyone working on this hopefully finds this.
I could add the code but leave it commented out in the Makefile so anyone working on this hopefully finds this.
This sounds fine to me, thanks!
I added a note to this along with information about why it should look like the way it looks.
@rfk I'm happy to help! Commits have been squashed and I merged latest master.
This pull request aims at making the switch to Python 3 easier. For most parts this is adjusting imports and some small syntax changes. The only entirely new part is the generation of a random key. Python 3 does not allow to directly convert bytes to hex and
binascii
allows an approach that runs under Python 2 and 3.A complete switch isn't possible until tokenserver is compatible with Python 3. Because of this no real test was possible. However this should fix the errors reported in #97.
The travis configuration has initially been expanded to use current Python 3s. But the way the selection of the Python version is made (
SYSTEMPYTHON = …
in Makefile) leads to travis always picking up Python 2 (all versions of Python are appearantly present in a travis environment) for the tasks.A proper fix for running in travis would be:
But since this could also affect everyday operation I did not implement it in this branch. Let me know if you think this should be changed!