From 8fcc96d615448d268731227bce0d09cba2914e7b Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 7 Jun 2014 03:20:56 -0700 Subject: [PATCH] git-{cola,dag}: support installation prefixes with utf-8 paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decode the bytestring so that os.path.join() can operate on it now that we're using unicode literals. Closes #282 Reported-by: V字龍(Vdragon) Signed-off-by: David Aguilar --- bin/git-cola | 2 ++ bin/git-dag | 2 ++ share/doc/git-cola/relnotes.rst | 2 ++ 3 files changed, 6 insertions(+) diff --git a/bin/git-cola b/bin/git-cola index 9a32180e7..ea22f46fd 100755 --- a/bin/git-cola +++ b/bin/git-cola @@ -34,6 +34,8 @@ def setup_environment(): # Try to detect where it is run from and set prefix and the search path. # It is assumed that the user installed Cola using the --prefix= option prefix = dirname(dirname(realpath(abspath(__file__)))) + if sys.version_info[0] == 2: + prefix = prefix.decode('utf-8', 'replace') # Look for modules in the source or install trees cola_mod = os.path.join(prefix, 'cola', '__init__.py') diff --git a/bin/git-dag b/bin/git-dag index 12b49ca92..6a41d0e1b 100755 --- a/bin/git-dag +++ b/bin/git-dag @@ -32,6 +32,8 @@ def setup_environment(): # Try to detect where it is run from and set prefix and the search path. # It is assumed that the user installed Cola using the --prefix= option prefix = dirname(dirname(realpath(abspath(__file__)))) + if sys.version_info[0] == 2: + prefix = prefix.decode('utf-8', 'replace') # Look for modules in the source or install trees cola_mod = os.path.join(prefix, 'cola', '__init__.py') diff --git a/share/doc/git-cola/relnotes.rst b/share/doc/git-cola/relnotes.rst index ef380998b..29f6ac04c 100644 --- a/share/doc/git-cola/relnotes.rst +++ b/share/doc/git-cola/relnotes.rst @@ -50,6 +50,8 @@ Fixes https://github.com/git-cola/git-cola/issues/273 + https://github.com/git-cola/git-cola/issues/282 + * Fix viewing history from the file browser on Python3. https://github.com/git-cola/git-cola/issues/274