cscorley / whatthepatch

What The Patch!? -- A Python patch parsing library
MIT License
64 stars 24 forks source link

AssertionError on a binary diff #56

Closed abbradar closed 1 year ago

abbradar commented 1 year ago

With this Git binary diff, I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/6qz1fvnb18gzydhm8awy94lrxb0sy2y5-python3.10-whatthepatch-1.0.4/lib/python3.10/site-packages/whatthepatch/patch.py", line 102, in parse_patch
    d = parse_diff(diff)
  File "/nix/store/6qz1fvnb18gzydhm8awy94lrxb0sy2y5-python3.10-whatthepatch-1.0.4/lib/python3.10/site-packages/whatthepatch/patch.py", line 199, in parse_diff
    return parser(lines)
  File "/nix/store/6qz1fvnb18gzydhm8awy94lrxb0sy2y5-python3.10-whatthepatch-1.0.4/lib/python3.10/site-packages/whatthepatch/patch.py", line 995, in parse_git_binary_diff
    assert len(line) >= 7 and ((len(line) - 2) % 5) != 0
AssertionError

This issue has originally been encountered in Ki.

babenek commented 1 year ago

Confirmed. The fix in PR #57

cscorley commented 1 year ago

Thanks for the help :)