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

Description

@zbuc

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

Activity

  1. Byron commented on Oct 12, 2012

    @Byron
    Member

    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.

  2. added this to the v0.3.5 - bugfixes milestone on Nov 19, 2014
  3. self-assigned this
    on Jan 9, 2015
  4. Byron commented on Jan 9, 2015

    @Byron
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions