Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Encoding problem #332

Open
Open
@StyXman

Description

@StyXman

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp