Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…n when repr was called implicitly
  • Loading branch information...
commit feb56d9e6fe68febbcd40a0924637f4d7d7f6556 1 parent 7a5a7bc
@markramm markramm authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 devtools/templates/turbogears/+package+/model/auth.py_tmpl
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.