Skip to content

'NoneType' object has no attribute 'groups' #35

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
masarliev opened this issue Oct 31, 2011 · 7 comments
Closed

'NoneType' object has no attribute 'groups' #35

masarliev opened this issue Oct 31, 2011 · 7 comments
Assignees

Comments

@masarliev
Copy link

Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'groups'
Exception Location: /usr/local/lib/python2.6/dist-packages/git/diff.py in _index_from_patch_format, line 301
Python Executable: /usr/bin/python
Python Version: 2.6.6

this happens when trying to "Swap two inputs" .

commit = repo.commit()
diff = commit.diff('HEAD~1', create_patch=True, R=True)

@Byron
Copy link
Member

Byron commented Oct 31, 2011

I would need a full stack trace.
Thanks !

@masarliev
Copy link
Author

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/var/www/gitlog/example/gitlog/decorators.py" in _dec
  2.     response = func(request, _args, *_kwargs)
    
    File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
  3.             return view_func(request, _args, *_kwargs)
    
    File "/var/www/gitlog/example/gitlog/projects.py" in commit
  4. diff = commit.diff('HEAD~1', create_patch=True, R=True)
    
    File "/usr/local/lib/python2.6/dist-packages/git/diff.py" in diff
  5.  index = diff_method(self.repo, proc.stdout)
    
    File "/usr/local/lib/python2.6/dist-packages/git/diff.py" in _index_from_patch_format
  6.          a_blob_id, b_blob_id, b_mode = header.groups()
    

Exception Type: AttributeError at /newrepo/commit/1c6336ab05f0ec6838143cb7167b2850862357d0/
Exception Value: 'NoneType' object has no attribute 'groups'

@Byron
Copy link
Member

Byron commented Oct 31, 2011

What is the git-python version you are using ?

@masarliev
Copy link
Author

'0.3.2 RC1'

@jimydirektsaft
Copy link

I see the same issue with debian unstable gitpython version 0.3.2~RC1-3 and openerp "project_git" (http://bit.ly/1oL9oqs). Is this issue still open in the last git version of gitpython?

Trace follows:
Server Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, _params)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, *_kw or {})
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, _args, *_kwargs)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, _args, *_kw)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, _args, *_kw)
File "/usr/lib/pymodules/python2.7/openerp/addons/oerp_project_git/project.py", line 240, in get_git_repo
context=context)
File "/usr/lib/pymodules/python2.7/openerp/addons/oerp_project_git/project.py", line 163, in get_all_commits
diff = get_diff_html(commit)
File "/usr/lib/pymodules/python2.7/openerp/addons/oerp_project_git/project.py", line 21, in get_diff_html
create_patch=True)
File "/usr/lib/python2.7/dist-packages/git/diff.py", line 101, in diff
index = diff_method(self.repo, proc.stdout)
File "/usr/lib/python2.7/dist-packages/git/diff.py", line 301, in _index_from_patch_format
a_blob_id, b_blob_id, b_mode = header.groups()
AttributeError: 'NoneType' object has no attribute 'groups'

@Byron
Copy link
Member

Byron commented Jun 19, 2014

I believe it's save to assume that the issue is still open: there is no pull request fixing this issue, nor did I work on it. However, maybe there are forks which fix the issue, that didn't submit a PR yet.

@Byron Byron added this to the v0.3.5 - bugfixes milestone Nov 19, 2014
@Byron Byron self-assigned this Jan 8, 2015
Byron added a commit that referenced this issue Jan 8, 2015
Helps fixing #35

Also, the production status was changed to 'stable', which should
have been done much earlier.
@Byron
Copy link
Member

Byron commented Jan 8, 2015

I have added an assertion to check for unusual diff formats that we might not be able to parse. It would be useful to know the repository that caused this issue, to help reproducing it.
However, for now I will close this issue, assuming that in the past years, the diff implementation was adjusted to the point it's actually working.

@Byron Byron closed this as completed Jan 8, 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

3 participants