Skip to content

Commit

Permalink
git-{cola,dag}: support installation prefixes with utf-8 paths
Browse files Browse the repository at this point in the history
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) <pika1021@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Jun 7, 2014
1 parent 3084fe2 commit 8fcc96d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/git-cola
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions bin/git-dag
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions share/doc/git-cola/relnotes.rst
Expand Up @@ -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
Expand Down

0 comments on commit 8fcc96d

Please sign in to comment.