Skip to content

"blame" not working on binary files? AttributeError: 'NoneType' object has no attribute 'groups' git/repo/base.py", line 625, in blame #74

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
zbuc opened this issue Oct 11, 2012 · 2 comments
Assignees

Comments

@zbuc
Copy link

zbuc commented Oct 11, 2012

When trying to run repo.blame('master', '/path/') against a binary file, I always receive an AttributeError

I hacked this patch that works for my needs

Line 624 of base.py:

                        m = self.re_tab_full_line.search(line)
                        blames[-1][0] = c
                        if m:
                            text,  = m.groups()
                            blames[-1][1].append( text )
                        else:
                            blames[-1][1].append( "Could not get blame info!" )

Not sure what the correct fix is as I'm not familiar with your code

@Byron
Copy link
Member

Byron commented Oct 12, 2012

Thanks for sharing this !
Apparently it tried to access the match even though that was None.

If you would like to donate your fix, please add a test to the existing ones that try to verify blame, and add a pull request.

@Byron Byron added this to the v0.3.5 - bugfixes milestone Nov 19, 2014
@Byron Byron self-assigned this Jan 9, 2015
@Byron Byron closed this as completed in 17f5d13 Jan 9, 2015
Byron added a commit that referenced this issue Jan 9, 2015
@Byron
Copy link
Member

Byron commented Jan 9, 2015

Binary files in blames are now supported and tested for.
Additionally, I have added a test to verify that diffs with binary files work as well.

Byron added a commit that referenced this issue Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants