Opened 9 years ago

Closed 9 years ago

#4451 closed (fixed)

[newforms-admin] UnicodeDecodeError at getext string in widgets

Reported by: glin@… Owned by: Adrian Holovaty
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This is bugreport of general bug. First I wrote one example where it happends:

When I have newforms django admin site in my language (Czek(cs), but it dosn't matter), and go to model page, which has DateTime field, I get UnicodeDecodeError, such like this ("Time" is "Čas" in Czek):

UnicodeDecodeError at /admin/cms/menu/62/
'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)
Request Method: 	GET
Request URL:
Exception Type: 	UnicodeDecodeError
Exception Value: 	'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)
Exception Location: 	/usr/lib/python2.4/site-packages/django/contrib/admin/ in format_output, line 42

The coresponding line is:

return u'<p class="datetime">%s %s<br />%s %s</p>' % \
     (_('Date:'), rendered_widgets[0], _('Time:'), rendered_widgets[1])

This bug happends at lot of places in, where gettext character is rendered to unicode string.

Change History (4)

comment:1 Changed 9 years ago by anonymous

Component: UncategorizedAdmin interface
Needs documentation: unset
Needs tests: unset
Owner: changed from Jacob to Adrian Holovaty
Patch needs improvement: unset

comment:2 Changed 9 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedAccepted
Version: SVNother branch

This can't be consistently fixed until we do the UnicodeBranch -> trunk -> NewformsAdminBranch merge hop. Then we can fix the new admin stuff to be unicode-aware.

comment:3 Changed 9 years ago by Adrian Holovaty

Version: other branchnewforms-admin

comment:4 Changed 9 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

Fixed in [5627].

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