Opened 17 years ago

Closed 17 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: no UI/UX: no

Description

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: 	http://127.0.0.1:8000/admin/cms/menu/62/
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/widgets.py 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 widgets.py, where gettext character is rendered to unicode string.

Change History (4)

comment:1 by anonymous, 17 years ago

Component: UncategorizedAdmin interface
Owner: changed from Jacob to Adrian Holovaty

comment:2 by Malcolm Tredinnick, 17 years ago

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 by Adrian Holovaty, 17 years ago

Version: other branchnewforms-admin

comment:4 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

Fixed in [5627].

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