From b28c2775f2159923407e473e4a8ed294713336d2 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 30 Apr 2010 21:46:34 +0200 Subject: zeitgeist hook: don't fail on umlauts --- examples/zeitgeist-git.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/zeitgeist-git.py b/examples/zeitgeist-git.py index 9c76fad..03106e2 100755 --- a/examples/zeitgeist-git.py +++ b/examples/zeitgeist-git.py @@ -56,8 +56,9 @@ def get_repo(): repo = None uri = subprocess.Popen(['git', 'config', '--get', 'remote.origin.url'], stdout=subprocess.PIPE).communicate()[0] + if uri: - uri = unicode(uri.strip()) + uri = uri.strip().decode(sys.getfilesystemencoding()) repo = unicode(uri.rsplit('/', 1)[1]) repo = repo.rsplit(u'.git', 1)[0] return repo, uri @@ -69,7 +70,7 @@ def main(argv): # FIXME: I'd be great if zeitgeist would allow for more detail: # * branch # * log summary (git log -1 --format=%s HEAD) - curdir = os.path.abspath(os.curdir) + curdir = os.path.abspath(os.curdir).decode(sys.getfilesystemencoding()) uri = u"file://%s" % curdir repo, origin = get_repo() -- cgit v1.2.3