-
Notifications
You must be signed in to change notification settings - Fork 657
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
Code update changes needed going from 2.14.4 to 3.0.8 #1042
Comments
I'm not sure I can follow here. The tests for 3.0.8 pass with Python 3.8/3.9/3.10. Besides, you say that you use Python 3.9, but then you refer to a path which seems to support py310. Can you please add some details? |
Oops. Typo fixed in my post. I was so focused on getting the old versions right, I messed up the current one. It may not be a "problem" in the code - do you run tests with -bb? That was how I found it. For the record, when I am updating projects to new Python or major package versions, I use these Python flags to dig out hidden problems:
I got the error when I used the first debug line to run the dev server and tried to load the home page, which has the Dashboard on it. I can access the CRUD interface pages without error. I am thinking its a change in how the affected function is to be used. Something that used to work fine back in Python 2.7. But with the change to Unicode strings, can actually cause a type-casting problem - possibly really subtle. |
No, I do not run tests with |
You can add those flags to whatever command you do run - instant benefit.
Using this environment under Python 3.10:
|
Adding the flags results with an error here. I'm running the tests with tox: |
Figure it out ... flags work now, but no error with using the dashboard. |
interesting.... I don't see any b'...' strings on my dashboard, so I have no idea what the potential problem is. I have not figured out what that code is even doing, or why. I wonder why I get these warnings and the tests don't? I did notice your Dashboard test file was a little light. I need to add MFA security and get latest bootstrap working in this project - to serve up a public web site in addition to the internal apps they have now. After I get that sorted, I will revisit this. Please leave open so I don't forget. |
I'm closing this since I've never been able to reproduce it. Please reopen if you think this issue is still valid. |
I am updating an existing project to Django 4.2 and Python 3.10 (Was DJ2.2 on Py3.7). I thought I had resolved all syntax changes etc. But, when I run the project with python -bb I get this error:
/home/rcooke/.pyenv/versions/py310dj42/lib/python3.10/site-packages/grappelli/dashboard/utils.py:113: BytesWarning: str() on a bytes instance
pattern_items.sort(key=lambda x: str(x[0]._meta.verbose_name_plural.encode('utf-8')))
I don't see a note about it, nor is it mentioned in the Release Notes for 3.0.8. Or release notes for 2.15.
This project was originally written for Python 2.7, so this might be something from way back.
The text was updated successfully, but these errors were encountered: