#9859 closed (fixed)
UnicodeDecodeError in admin views for python 2.3.
Reported by: | Nils Fredrik Gjerull | Owned by: | Karen Tracey |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | unicode unicodedecodeerror | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Because I work in a company that uses python 2.3 on the production server and because I use characters outside the ascii range, I have run onto a number of UnicodeDecodeErrors. Python 2.3 unfortunately has a bug, it calls str methods on objects included in unicode template strings even if the object has a unicode method.
Now I have run onto another one. It was a quick fix to solve this, but it was more difficult to make a regression test for it. This bug is only triggered if a model is registered as a inline, but not registered directly with the admin.
To help fight UnicodeDecodeErrors I have made a new TestCase class in the admin_views regression test with the sole purpose of detecting missing force_unicode calls in the admin views.
Attachments (1)
Change History (5)
by , 16 years ago
Attachment: | admin_unicode_fixes.diff added |
---|
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 16 years ago
comment:4 by , 16 years ago
(In [9658]) [1.0.X] Fixed #9859 -- Added another missing force_unicode needed in admin when running on Python 2.3. Many thanks for report & patch with test to nfg.
Also enhanced the new test to hopefully exercise all paths through the get_deleted_objects function, and fixed the errors pointed out by the beefed-up test.
Thanks for the report, fix, and test. Does your company have plans to upgrade to a higher level of Python? Django will be dropping Python 2.3 support at some point, though I'm not sure if it's been finally decided exactly when yet.