summaryrefslogtreecommitdiff
path: root/gitdb/db
diff options
context:
space:
mode:
authorKevin Brown <kevin@kevinbrown.in>2014-07-13 19:55:00 -0400
committerKevin Brown <kevin@kevinbrown.in>2014-07-13 19:55:00 -0400
commitd8405ee00bfc1ebdae7c41b45f8c374902a3d2b4 (patch)
tree9d24be0480a83b02358ad4612e7b2365a04f7489 /gitdb/db
parent0269405121d7ef065f7008c9c033e95e734f029a (diff)
downloadgitdb-d8405ee00bfc1ebdae7c41b45f8c374902a3d2b4.tar.gz
More bytes handling
Diffstat (limited to 'gitdb/db')
-rw-r--r--gitdb/db/base.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gitdb/db/base.py b/gitdb/db/base.py
index 85df324..aa7a7ee 100644
--- a/gitdb/db/base.py
+++ b/gitdb/db/base.py
@@ -22,6 +22,8 @@ from async import (
from itertools import chain
from functools import reduce
+import sys
+
__all__ = ('ObjectDBR', 'ObjectDBW', 'FileDBBase', 'CompoundDB', 'CachingDB')
@@ -176,6 +178,14 @@ class FileDBBase(object):
"""
:return: the given relative path relative to our database root, allowing
to pontentially access datafiles"""
+ if sys.version_info[0] == 3:
+ text_type = str
+ else:
+ text_type = basestring
+
+ if not isinstance(rela_path, text_type):
+ rela_path = rela_path.decode("utf-8")
+
return join(self._root_path, rela_path)
#} END interface