Opened 16 years ago

Closed 16 years ago

#5661 closed (fixed)

UnicodeDecodeError while removing objects -> no ugettext import

Reported by: Maciej Wiśniowski Owned by: Yves Serrano
Component: contrib.admin Version: newforms-admin
Severity: Keywords: unicode utils.py ugettext nfa-blocker
Cc: pigletto@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

File admin/util.py lacks import statement:
from django.utils.translation import ugettext as _

which causes UnicodeDecodeError.
Patch attached.

Attachments (1)

patch_rev6442_unicode.diff (450 bytes ) - added by Maciej Wiśniowski 16 years ago.

Download all attachments as: .zip

Change History (10)

by Maciej Wiśniowski, 16 years ago

Attachment: patch_rev6442_unicode.diff added

comment:1 by Maciej Wiśniowski, 16 years ago

Cc: pigletto@… added

comment:2 by Yves Serrano, 16 years ago

Owner: changed from nobody to Yves Serrano

I also had this problem, but it seems it's gone away in the newer revisions (I looked at r6782)

comment:3 by Maciej Wiśniowski, 16 years ago

I think problem is still there as in util.py file _(..) is used but is not explicitly imported.

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

Yes, it's used here:

http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/util.py#L88

and here:

http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/util.py#L93

without having been imported. Those are both under a "for related in opts.get_all_related_many_to_many_objects():" and and "if has_related_objs:" so you need to be deleting something with some many-to-many relations in order to trip the error.

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

Component: Contrib appsAdmin interface
Triage Stage: UnreviewedReady for checkin

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

Keywords: nfa-blocker added

Regression from trunk that limits function and has a trivial fix, so marking blocking for merge.

comment:7 by Tom Vergote, 16 years ago

closing #6424 in favor of this one

comment:8 by Tom Vergote, 16 years ago

closing #6438 in favor of this one

comment:9 by Brian Rosner, 16 years ago

Resolution: fixed
Status: newclosed

(In [7225]) newforms-admin: Fixed #5661. Added a missing import.

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