Skip to content

UnicodeDecodeError when looking at the tagged_date #943

Closed
@cydan33

Description

@cydan33

I can't get the tagged date for some repository tags.

For example -

import git
r = git.Repo.clone_from("https://github.com/nodejs/node", "/tmp/nodegit")
t = r.tags[10]
t.object.tagged_date

Error -

~/.local/lib/python3.7/site-packages/gitdb/util.py in __getattr__(self, attr)
    251         to be created and set. Next time the same attribute is reqeusted, it is simply
    252         returned from our dict/slots. """
--> 253         self._set_cache_(attr)
    254         # will raise in case the cache was not created
    255         return object.__getattribute__(self, attr)

/tmp/GitPython/git/objects/tag.py in _set_cache_(self, attr)
     51         if attr in TagObject.__slots__:
     52             ostream = self.repo.odb.stream(self.binsha)
---> 53             lines = ostream.read().decode(defenc).splitlines()
     54
     55             _obj, hexsha = lines[0].split(" ")

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 392: invalid continuation byte

It happens for the following repositories -
https://github.com/nodejs/node (tag "v0.1.0")
https://github.com/OpenVPN/openvpn (tag "v2.3.1")

It reproduces in the latest version.

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