Skip to content

Commit

Permalink
[#368] Return utf-8 encoded string from __repr__ so that pprint which…
Browse files Browse the repository at this point in the history
… calls repr() does not choke on unicode characters in tags
  • Loading branch information
domoritz committed Mar 16, 2013
1 parent 224f97a commit 5a77d67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/model/tag.py
Expand Up @@ -230,7 +230,8 @@ def __init__(self, package=None, tag=None, state=None, **kwargs):
setattr(self, k, v)

def __repr__(self):
return '<PackageTag package=%s tag=%s>' % (self.package.name, self.tag.name)
s = u'<PackageTag package=%s tag=%s>' % (self.package.name, self.tag.name)
return s.encode('utf8')

def activity_stream_detail(self, activity_id, activity_type):
if activity_type == 'new':
Expand Down

0 comments on commit 5a77d67

Please sign in to comment.