Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#8153 closed (duplicate)

UnicodeDecodeError in ModelAdmin (save_add and save_change)

Reported by: Nils Fredrik Gjerull Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: unicode modeladmin save_add
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

UnicodeDecodeError in save_add and save_change in ModelAdmin

I experienced a UnicodeDecodeError when I added and changed objects through the admin interface. The problem applied to objects having a unicode(self) function returning strings containing non-ASCII characters.

Django trunk revision 8225
Python version: 2.3.4

I attach a patch the admin_views regression test so that it triggers this bug, and a patch that solves the problem.

Attachments (2)

modeladmin_options_test.diff (2.1 KB) - added by Nils Fredrik Gjerull 8 years ago.
modeladmin_options.diff (1.6 KB) - added by Nils Fredrik Gjerull 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Nils Fredrik Gjerull

Changed 8 years ago by Nils Fredrik Gjerull

Attachment: modeladmin_options.diff added

comment:1 Changed 8 years ago by Karen Tracey <kmtracey@…>

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

#8151 was already opened to fix this and make sure there are no more missing force_unicode wrappers in this code, I've added a pointer to this report/patch there.

comment:2 Changed 8 years ago by Malcolm Tredinnick

(In [8236]) Added a few force_unicode() calls around objects in the admin. Required for
Python 2.3 compatibility. Patch from nfg.

Refs #8151, #8153.

Note: See TracTickets for help on using tickets.
Back to Top