aboutsummaryrefslogtreecommitdiff
path: root/git/objects/tag.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/objects/tag.py')
-rw-r--r--git/objects/tag.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/git/objects/tag.py b/git/objects/tag.py
index 3c379579..c8684447 100644
--- a/git/objects/tag.py
+++ b/git/objects/tag.py
@@ -4,12 +4,13 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
""" Module containing all object based types. """
-import base
-from gitdb.util import hex_to_bin
-from util import (
+from . import base
+from .util import (
get_object_type_by_name,
parse_actor_and_date
)
+from gitdb.util import hex_to_bin
+from git.compat import defenc
__all__ = ("TagObject", )
@@ -52,11 +53,12 @@ class TagObject(base.Object):
"""Cache all our attributes at once"""
if attr in TagObject.__slots__:
ostream = self.repo.odb.stream(self.binsha)
- lines = ostream.read().splitlines()
+ lines = ostream.read().decode(defenc).splitlines()
obj, hexsha = lines[0].split(" ") # object <hexsha>
type_token, type_name = lines[1].split(" ") # type <type_name>
- self.object = get_object_type_by_name(type_name)(self.repo, hex_to_bin(hexsha))
+ self.object = \
+ get_object_type_by_name(type_name.encode('ascii'))(self.repo, hex_to_bin(hexsha))
self.tag = lines[2][4:] # tag <tag name>