Permalink
Browse files

More unicode issues resolved.

  • Loading branch information...
1 parent 7bb87af commit f343e5c9ea7c5f35fa22747c6a6f725532569575 @mcepl mcepl committed Jun 18, 2012
Showing with 9 additions and 8 deletions.
  1. +4 −5 git-issues
  2. +5 −3 gitshelve.py
View
@@ -82,8 +82,8 @@ class Person:
self.name = name
self.email = email
- def __str__(self):
- return "%s <%s>" % (self.name, self.email)
+ def __unicode__(self):
+ return u"%s <%s>" % (self.name, self.email)
class Comment:
@@ -800,7 +800,6 @@ class XmlIssueSetBuilder:
class XmlBuilder:
def build(cls, data, node=None, doc=None):
- print("data = %s" % data)
if data is None:
pass
elif isinstance(data, datetime):
@@ -886,8 +885,8 @@ class GitIssueSet(IssueSet):
def current_author(self):
if self.GIT_AUTHOR is None:
- self.GIT_AUTHOR = Person(unicode(gitshelve.git('config', 'user.name'), "utf-8"),
- unicode(gitshelve.git('config', 'user.email'), "utf-8"))
+ self.GIT_AUTHOR = Person(gitshelve.git('config', 'user.name'),
+ gitshelve.git('config', 'user.email'))
return self.GIT_AUTHOR
def allocate_issue(self, title):
View
@@ -65,12 +65,12 @@ def __init__(self, cmd, args, kwargs, stderr=None):
self.stderr = stderr
Exception.__init__(self)
- def __str__(self):
+ def __unicode__(self):
if self.stderr:
- return "Git command failed: git %s %s: %s" % \
+ return u"Git command failed: git %s %s: %s" % \
(self.cmd, self.args, self.stderr)
else:
- return "Git command failed: git %s %s" % (self.cmd, self.args)
+ return u"Git command failed: git %s %s" % (self.cmd, self.args)
def git(cmd, *args, **kwargs):
@@ -117,6 +117,8 @@ def git(cmd, *args, **kwargs):
else:
input = ''
+ if isinstance(input, unicode):
+ input = input.encode("utf-8")
out, err = proc.communicate(input)
returncode = proc.returncode

0 comments on commit f343e5c

Please sign in to comment.