-
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
Upgrade to Python 3 #3411
Upgrade to Python 3 #3411
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I believe the final errors are caused by these bits of code: ESP-Website/esp/esp/users/models/__init__.py Lines 2009 to 2016 in 5eeecff
ESP-Website/esp/esp/users/models/__init__.py Lines 2023 to 2030 in 5eeecff
The I think ultimately we want the Also, it's possible this would break Python 2 backwards compatibility, but strangely enough my initial testing doesn't seem to indicate that. |
This pull request introduces 50 alerts and fixes 100 when merging 2b6cc20 into 5eeecff - view on LGTM.com new alerts:
fixed alerts:
|
Yes, the final errors are pickle issues which I will work on fixing with the plan I wrote many comments ago. So far I have figured out how to switch between running Python 2 and 3 on Also, these may not be the "final" errors. Once these errors are fixed, they may unmask more errors :) |
Ah, yes, there've been so many comments and LGTM comments that I totally forgot you already had a plan! I've got the pickled errors temporarily fixed for my travis builds, so I can start preemptively fixing the new errors. |
I've run into an issue with ESP-Website/esp/esp/dbmail/models.py Line 480 in 5eeecff
However, you can't pickle a BinaryField because it's converted to a memoryview by Django:https://github.com/django/django/blob/2da029d8540ab0b2e9edcba25c4d46c52853197f/django/db/models/fields/__init__.py#L2303-L2307 So I guess our options are to either make these JSON fields now (instead of waiting until the future) or partially revert the changes in #3129? The good news is that I'm not getting any other errors (after the fixes in dc1b1a2)! |
Here are some comments for each of the currently pickled model fields: PersistentQueryFilter.q_filter MessageRequest.special_headers ESP-Website/esp/esp/program/modules/handlers/commmodule.py Lines 191 to 192 in f161031
MessageVars.pickled_provider ResourceType.attributes_pickled Answer.value |
5e141c9
to
be64bb4
Compare
Resolved by #3616; closing |
This is a very much work-in-progress PR to migrate from Python 2 to Python 3.
TODO:
cmp()
, fix uses ofsort()
andsorted()
(python docs) (more python docs aboutcmp
tokey
)/
(Python 2) has been changed to//
(Python 3) in all the right places (I did a first pass on this in Some changes for python 3 migration unrelated to strings and bytes #3412 but should be double-checked)Fixes #2576. Fixes #2820.