Opened 9 years ago

Closed 9 years ago

#5661 closed (fixed)

UnicodeDecodeError while removing objects -> no ugettext import

Reported by: pigletto 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: UI/UX:

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 pigletto 9 years ago.

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by pigletto

Attachment: patch_rev6442_unicode.diff added

comment:1 Changed 9 years ago by pigletto

Cc: pigletto@… added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 9 years ago by Yves Serrano

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 Changed 9 years ago by pigletto

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

comment:4 Changed 9 years ago by Karen Tracey <kmtracey@…>

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 Changed 9 years ago by Karen Tracey <kmtracey@…>

Component: Contrib appsAdmin interface
Triage Stage: UnreviewedReady for checkin

comment:6 Changed 9 years ago by Karen Tracey <kmtracey@…>

Keywords: nfa-blocker added

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

comment:7 Changed 9 years ago by Tom Vergote

closing #6424 in favor of this one

comment:8 Changed 9 years ago by Tom Vergote

closing #6438 in favor of this one

comment:9 Changed 9 years ago by Brian Rosner

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