#20 Python code will run in python3 only
Opened by aawizard. Modified
aawizard/fedora-contributor-trends python3-as-default  into  main

Download 20.patch

As code is now compatible with python3 it is showing compatibility errors with pickle file
As a resolution, if the python files are run in python3 always
Example: in file get-weekly-user-stats.sh
until python weekly-user-activity.py org.fedoraproject.prod.irc.karma; do sleep 5; done
to
until python3 weekly-user-activity.py org.fedoraproject.prod.irc.karma; do sleep 5; done
Now if a system has both the versions of python the code will only run in python3

@mattdm Please review my PR is this a valid solution or contribution to the project

I thought about it when I made the change but the idea is that before running the code an environment has been created and activated, that is, made something like that:

python3 -m venv <env_name>
source <env_name>/bin/activate

That way we make sure that the Python interpreter is always Python3, however, we can wait for the opinion of @mattdm :smile:

Yeah, I agree -- we shouldn't try to support python2 as an interpreter, but I like the idea of allowing virtual environments to work easily.

Metadata