-
Notifications
You must be signed in to change notification settings - Fork 57
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
Migration to Python3 #3616
base: main
Are you sure you want to change the base?
Migration to Python3 #3616
Conversation
full command/config: python -m modernize --no-diffs --write --nobackups --six-unicode --enforce --fix=default --fix=libmodernize.fixes.fix_open -f classic_division -f open -f idioms -f set_literal -f ws_comma .
Regarding Python 3.7, its end-of-life is only a few months way (2023-06-27). |
Good catch, Ted. I think we want to avoid upgrading Django in this PR (the main limiting library), but we should make a separate issue to bump Django as soon as possible. Then we can bump to a current version of Python. Only potential reason I can see to do it sooner is that this tool https://docs.python.org/3.10/library/functools.html#functools.cmp_to_key buys us a lot of ground with the |
Change 'is' to '==' when used with a literal 'png' drop database test_test_django in the before_script
Since __name__ requires `str` type, also add a `str` cast in create_membership_method.
…ESP-Website into migration-to-python3
I've been out of the loop on this PR for a while but it's great that you find a solution to the pickle migration problem. And also, |
When running
|
I also ran into the same error that @kkbrum encountered while trying to run
I tried dropping the tablespace, and got this warning:
Then I reran
|
I made a new, clean VM for Ubuntu 24.04, so hoping that fixes things. Try again, reviewers! |
That seems to have worked @milescalabresi. I've got a python 3 dev server up and running now! Although I will note that it seems to be running significantly slower than before. I realize that all of the caching needs to be done again, but even loading the same page or submitting a form takes a looooong time. |
It worked for me as well. Mine seems a bit slower than before as well, but not as significantly as it seems to be for Will. |
…ESP-Website into migration-to-python3
…ESP-Website into migration-to-python3
response = HttpResponse(content_type='application/pdf') | ||
response = HttpResponse(content=render_to_latex(basedir+'studentschedule.tex', context, 'pdf'), | ||
content_type='application/pdf') | ||
response['Content-Disposition'] = 'attachment; filename="studentschedules.pdf"' | ||
response.write(render_to_latex(basedir+'studentschedule.tex', context, 'pdf')) |
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.
@willgearty what is this supposed to do? I'm not sure I understand
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.
Not sure why, but on Python 3 the student schedule download was broken. This fixes it.
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.
can you help me understand what this change does? This is the file that causes the database errors that are making the PR tests fail
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.
That's bizarre. There shouldn't be anything different here than what was happening before on Python 2. We render the schedules as a pdf, then set the response as a file download. That's basically it.
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.
yeah I don't understand it. Maybe best to discuss in real time.... Or maybe this was actually mitigating an error in another file. Stack seems to indicate these requests are notoriously asynchronous/hard to debug 🤷 😢
Migrate the codebase to Python 3 (currently 3.7, aiming for higher once we bump Django and other packages)