Opened 16 years ago

Closed 16 years ago

Last modified 16 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: dev
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: no UI/UX: no

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 16 years ago.
modeladmin_options.diff (1.6 KB ) - added by Nils Fredrik Gjerull 16 years ago.

Download all attachments as: .zip

Change History (4)

by Nils Fredrik Gjerull, 16 years ago

by Nils Fredrik Gjerull, 16 years ago

Attachment: modeladmin_options.diff added

comment:1 by Karen Tracey <kmtracey@…>, 16 years ago

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 by Malcolm Tredinnick, 16 years ago

(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