Django

Code

Ticket #5661 (closed: fixed)

Opened 9 months ago

Last modified 4 months ago

UnicodeDecodeError while removing objects -> no ugettext import

Reported by: pigletto Assigned to: yserrano
Milestone: Component: Admin interface
Version: newforms-admin Keywords: unicode utils.py ugettext nfa-blocker
Cc: pigletto@gmail.com Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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

which causes UnicodeDecodeError?. Patch attached.

Attachments

patch_rev6442_unicode.diff (450 bytes) - added by pigletto on 10/02/07 02:15:43.

Change History

10/02/07 02:15:43 changed by pigletto

  • attachment patch_rev6442_unicode.diff added.

10/02/07 02:16:24 changed by pigletto

  • cc set to pigletto@gmail.com.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

12/01/07 12:08:33 changed by yserrano

  • owner changed from nobody to yserrano.

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

12/01/07 16:55:07 changed by pigletto

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

12/01/07 17:36:14 changed by Karen Tracey <kmtracey@gmail.com>

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.

12/01/07 17:43:36 changed by Karen Tracey <kmtracey@gmail.com>

  • component changed from Contrib apps to Admin interface.
  • stage changed from Unreviewed to Ready for checkin.

12/08/07 08:13:59 changed by Karen Tracey <kmtracey@gmail.com>

  • keywords changed from unicode utils.py ugettext to unicode utils.py ugettext nfa-blocker.

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

01/21/08 11:20:48 changed by tvrg

closing #6424 in favor of this one

01/22/08 04:04:05 changed by tvrg

closing #6438 in favor of this one

03/11/08 14:43:06 changed by brosner

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #5661 (UnicodeDecodeError while removing objects -> no ugettext import)




Change Properties
Action