Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
Open
Description
I'm not sure this is a proper way to useTagReferences
, but it's definitely unexpected. This time I'm usingGitPython
installed by pypi.
I have this nice tag:
In [8]:tagOut[8]:<git.TagReference"refs/tags/PROMOTED_1501131729_MKT15_01_12_QU_1">
I can get a lot of info out of it:
In [9]:tag.object.hexshaOut[9]:u'dca63c5c7e6aab3cd4934e60230ec3419ab87071'In [12]:tag.nameOut[12]:'PROMOTED_1501131729_MKT15_01_12_QU_1'In [13]:tag.objectOut[13]:<git.TagObject"dca63c5c7e6aab3cd4934e60230ec3419ab87071">In [14]:tag.refTypeError:PROMOTED_1501131729_MKT15_01_12_QU_1isadetachedsymbolicreferenceasitpointsto'dca63c5c7e6aab3cd4934e60230ec3419ab87071'
But this fails:
In [15]:tag.commit---------------------------------------------------------------------------UnicodeDecodeErrorTraceback (mostrecentcalllast)<ipython-input-15-2431a6e80cf9>in<module>()---->1tag.commit/home/mdione/local/lib/python2.7/site-packages/git/refs/tag.pycincommit(self)29elifobj.type=="tag":30# it is a tag object which carries the commit as an object - we can point to anything--->31returnobj.object32else:33raiseValueError("Tag %s points to a Blob or Tree - have never seen that before"%self)/home/mdione/local/lib/python2.7/site-packages/gitdb/util.pycin__getattr__(self,attr)-->237self._set_cache_(attr)238# will raise in case the cache was not created239returnobject.__getattribute__(self,attr)/home/mdione/local/lib/python2.7/site-packages/git/objects/tag.pycin_set_cache_(self,attr)54ifattrinTagObject.__slots__:55ostream=self.repo.odb.stream(self.binsha)--->56lines=ostream.read().decode(defenc).splitlines()5758obj,hexsha=lines[0].split(" ")# object <hexsha>/usr/lib/python2.7/encodings/utf_8.pycindecode(input,errors)1415defdecode(input,errors='strict'):--->16returncodecs.utf_8_decode(input,errors,True)1718classIncrementalEncoder(codecs.IncrementalEncoder):UnicodeDecodeError:'utf8'codeccan'tdecodebyte0xa8inposition108:invalidstartbyte
Unluckily this is happening with an internal repo and I don't know how to even try to reproduce with a public one. Meanwhile I can workaround it by usingtag.object.hexsha
, which is what I wanted.