Permalink
Browse files

Add an explicit encoding to repr strings to avoid errors in old pytho…

…n when repr was called implicitly
  • Loading branch information...
markramm committed Sep 25, 2010
1 parent 7a5a7bc commit feb56d9e6fe68febbcd40a0924637f4d7d7f6556
Showing with 4 additions and 4 deletions.
  1. +4 −4 devtools/templates/turbogears/+package+/model/auth.py_tmpl
@@ -82,7 +82,7 @@ class Group(DeclarativeBase):
#{ Special methods
def __repr__(self):
- return '<Group: name=%r>' % self.group_name
+ return ('<Group: name=%s>' % self.group_name).encode('utf-8')
def __unicode__(self):
return self.group_name
@@ -122,8 +122,8 @@ class User(DeclarativeBase):
#{ Special methods
def __repr__(self):
- return '<User: name=%r, email=%r, display=%r>' % (
- self.user_name, self.email_address, self.display_name)
+ return ('<User: name=%r, email=%r, display=%r>' % (
+ self.user_name, self.email_address, self.display_name)).encode('utf-8')
def __unicode__(self):
return self.display_name or self.user_name
@@ -218,7 +218,7 @@ class Permission(DeclarativeBase):
#{ Special methods
def __repr__(self):
- return '<Permission: name=%r>' % self.permission_name
+ return ('<Permission: name=%r>' % self.permission_name).encode('utf-8')
def __unicode__(self):
return self.permission_name

0 comments on commit feb56d9

Please sign in to comment.