Skip to content

GitPython breaks with an - unknown encoding - error. #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pjps opened this issue Jun 17, 2013 · 6 comments
Closed

GitPython breaks with an - unknown encoding - error. #110

pjps opened this issue Jun 17, 2013 · 6 comments
Milestone

Comments

@pjps
Copy link

pjps commented Jun 17, 2013

This error occurs while listing files associated with a given commit. On a Fedora-17 machine with GitPython-0.3.2-0.2.RC1.fc17.noarch.

-> https://git.kernel.org/linus/ad3e2751e7c546ae678be1f8d86e898506b42cef

$ python
Python 2.7.3 (default, Jul 24 2012, 10:05:38)

from git import repo
rp = repo.Repo('~/linux/")
cm = rp.commit("ad3e2751e7")

cm.stats.files.keys()
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 217, in stats
if not self.parents:
File "/usr/lib64/python2.7/site-packages/gitdb/util.py", line 238, in getattr
self.set_cache(attr)
File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 132, in set_cache
self._deserialize(StringIO(stream.read()))
File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 443, in _deserialize
self.author.name = self.author.name.decode(self.encoding)
LookupError: unknown encoding: -----BEGIN PGP SIGNATURE-----

@pjps
Copy link
Author

pjps commented Jun 17, 2013

Even doing - cm.message - throws the same

cm.message
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python2.7/site-packages/gitdb/util.py", line 238, in getattr
self.set_cache(attr)
File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 132, in set_cache
self._deserialize(StringIO(stream.read()))
File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 443, in _deserialize
self.author.name = self.author.name.decode(self.encoding)
LookupError: unknown encoding: -----BEGIN PGP SIGNATURE-----

@ignatenkobrain
Copy link

Confirm.

@jschlather
Copy link

Is this the same issue as #57?

@ignatenkobrain
Copy link

On Sun, 2013-09-22 at 09:14 -0700, jschlather wrote:

Is this the same issue as #57?
For my case I've applied
johnsca@db82455 and it's works OK.

Igor Gnatenko
Fedora release 20 (Heisenbug)
Linux 3.11.1-300.fc20.x86_64

@ignatenkobrain
Copy link

But patch from #57 works correctly too.

@Byron Byron added this to the v0.3.2 milestone Nov 19, 2014
@Byron
Copy link
Member

Byron commented Nov 19, 2014

The fix is now available on pypi in version 0.3.2 .

@Byron Byron closed this as completed Nov 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants