-
Notifications
You must be signed in to change notification settings - Fork 449
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
Change python scripts to use python3. #4043
Conversation
You have to install mysqlclient for python3; that has the same interface as mysqldb, which we used with python2.
- Use from __future__ import print_function - fix input/raw_input discrepancy
BTW, this is essentially the same as #3259, with a couple of extra things. |
I tested this (make_project and start) with python 2.7.17 and 3.6.9 |
These scripts looks suspicious for me (and contain a lot of broken and outdated stuff). I ran pylint on it (to check both python2 and python3 correctness) and it showed me a lot of errors. I'll create a PR with CI to check this and probably help fix these scripts. |
@davidpanderson, here's an example of pylint (for python2, for python3 it looks similar): https://travis-ci.org/github/BOINC/boinc/jobs/732352359 CI job is not finished yet but you can see errors already (those one that starts with Please let me know what do you think about it and whether they are valid and should be fixed. Later I plan to finish these CI jobs and fill them with all valuable Python scripts. |
pylint's complaints are not related to this PR; please move to new issue if you want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two of four files (that have no *.py extension) have changed python
to python3
.
I'm not sure these scripts will run with python2. In any case, all four should be unified.
Pylint found a lot of errors but they are pretty much similar for both python2 and python3 and not related to this particular PR.
They should be definitely fixed but in a separate PRs.
These scripts work with python 2 and 3
Greetings - I started working on testing this out first with a python3 on Ubuntu. I got the following error message while trying to run the make_project script:
which I am guessing is because of this:
Which appears to occur due to the reason cited in this stackoverflow: https://stackoverflow.com/questions/20873285/unboundlocalerror-local-variable-input-referenced-before-assignment |
Fixed; please try again. |
I tested creating a new project on Red Hat Enterprise Linux 7 (which has python 2 at /usr/bin/python) and Ubuntu 20.04 (via WSL) which has python 3 at /usr/bin/python. Both were successful and I was able to get the sample app installed and get the daemons running. I think this looks good. Thanks for making python 3 a viable option! |
You have to install mysqlclient for python3;
that has the same interface as mysqldb, which we used with python2.
The scripts don't work with python2.