From f4be9dfc701440a2ed65a53ec4dd38237d426b99 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Sun, 15 Sep 2013 14:56:01 +0000 Subject: [PATCH] Cope with UnicodeDecodeError on git svn output svn: r23138 --- gramps/gen/svn_revision.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gramps/gen/svn_revision.py b/gramps/gen/svn_revision.py index 52c24ed81..0a33f8c82 100644 --- a/gramps/gen/svn_revision.py +++ b/gramps/gen/svn_revision.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # @@ -20,6 +21,8 @@ # $Id$ +from __future__ import unicode_literals + import sys import subprocess import re @@ -43,7 +46,10 @@ def _get_svn_revision(path, command, stdout_to_rev): return "" # subprocess failed # subprocess worked if stdout and len(stdout) > 0: # has output - stdout = cuni(stdout) # get a proper string + try: + stdout = cuni(stdout) # get a proper string + except UnicodeDecodeError: + pass rev = stdout_to_rev(stdout) return "-r" + rev if rev else "" else: # no output from svnversion