erikbern / git-of-theseus

Analyze how a Git repo grows over time

Home Page:https://erikbern.com/2016/12/05/the-half-life-of-code.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Failed to parse delta stream" error

chrislloyd opened this issue · comments

Hi! This looks awesome :) I was excited to try it out but ran into this error on a repo:

Listing all commits
- 162149 Elapsed Time: 0:01:02                                                                                                             Backtracking the master branch
/ 96504 Elapsed Time: 0:00:26                                                                                                              Counting total entries to analyze
  0% (  0 of 338) |                                                                                  | Elapsed Time: 0:00:00 ETA:  --:--:--Traceback (most recent call last):
  File "analyze.py", line 61, in <module>
    for entry in get_entries(commit):
  File "analyze.py", line 50, in get_entries
    return [entry for entry in commit.tree.traverse()
  File "/usr/local/lib/python2.7/site-packages/git/objects/util.py", line 296, in traverse
    addToStack( stack, item, branch_first, nd )
  File "/usr/local/lib/python2.7/site-packages/git/objects/util.py", line 264, in addToStack
    lst = self._get_intermediate_items( item )
  File "/usr/local/lib/python2.7/site-packages/git/objects/tree.py", line 138, in _get_intermediate_items
    return tuple(index_object._iter_convert_to_object(index_object._cache))
  File "/usr/local/lib/python2.7/site-packages/gitdb/util.py", line 237, in __getattr__
    self._set_cache_(attr)
  File "/usr/local/lib/python2.7/site-packages/git/objects/tree.py", line 145, in _set_cache_
    self._cache = tree_entries_from_data(ostream.read())
  File "/usr/local/lib/python2.7/site-packages/gitdb/base.py", line 138, in read
    return self[3].read(size)
  File "/usr/local/lib/python2.7/site-packages/gitdb/stream.py", line 489, in read
    bl = self._size - self._br      # bytes left
  File "/usr/local/lib/python2.7/site-packages/gitdb/util.py", line 237, in __getattr__
    self._set_cache_(attr)
  File "/usr/local/lib/python2.7/site-packages/gitdb/stream.py", line 384, in _set_cache_too_slow_without_c
    dcl = connect_deltas(self._dstreams)
RuntimeError: Failed to parse delta stream

Any ideas or first steps to debug?

Seems like an issue for GitPython not this project... sorry not sure how to debug :(

Thanks for the reply!

For those Googling this issue in the future, this was solved by using Python3. It was caused by using Python2 with repos which contain unicode characters.