Opened 10 years ago

Closed 10 years ago

#24454 closed Bug (fixed)

SimpleLazyObject __repr__ does not work for collections.namedtuple

Reported by: Emil Temirov Owned by: Tino de Bruijn
Component: Core (Other) Version: dev
Severity: Normal Keywords: SimpleLazyObject, namedtuple, __repr__
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Patch:

--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -349,7 +349,7 @@ class SimpleLazyObject(LazyObject):
             repr_attr = self._setupfunc
         else:
             repr_attr = self._wrapped
-        return '<SimpleLazyObject: %r>' % repr_attr
+        return '<SimpleLazyObject: %r>' % (repr_attr, )
 
     # Need to pretend to be the wrapped class, for the sake of objects that
     # care about this (especially in equality tests)

Change History (3)

comment:1 by Claude Paroz, 10 years ago

Easy pickings: set
Needs tests: set
Triage Stage: UnreviewedAccepted
UI/UX: unset
Version: 1.6master

A test would be nice.

comment:2 by Tino de Bruijn, 10 years ago

Owner: changed from nobody to Tino de Bruijn
Status: newassigned

comment:3 by Tino de Bruijn, 10 years ago

Has patch: unset
Needs tests: unset
Resolution: fixed
Status: assignedclosed

Already fixed in 61917aa08b4ab2bc35f3ffe87b7693bd8b58e205, which is part of 1.7 already.

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