git-upstream doesn't work with gitpython-2.0.9

Bug #1634053 reported by
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Status tracked in Trunk
Fix Released
Fix Released
Darragh Bailey

Bug Description

2016-10-17.09:57 desbonne@kilcolgan2:~/src/$ pip freeze | grep -i git
  2016-10-17.09:57 desbonne@kilcolgan2:~/src/$ git-upstream import --into hp/prerelease/newton stable/newton
  Traceback (most recent call last):
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/bin/git-upstream", line 11, in <module>
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/", line 142, in main
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/commands/", line 71, in run
      return self.execute()
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/commands/", line 145, in execute
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/lib/", line 48, in __init__
      super(ImportUpstream, self).__init__(*args, **kwargs)
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/", line 154, in __init__
      super(LogDedentMixin, self).__init__(*args, **kwargs)
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git_upstream/lib/", line 39, in __init__
    File "/tmp/with_workspace.37QzIZ/_workspace_venv/local/lib/python2.7/site-packages/git/repo/", line 146, in __init__
      self.git_dir = None
  AttributeError: can't set attribute

Looks like due to the _GitUpstreamCompatRepo_ class being wrapped around the git.Repo class. Latest gitpython-2.0.9 drops the __slots__ attribute from the base repo class which breaks the hasattr test in (mdes)
description: updated
Changed in git-upstream:
importance: Undecided → Critical
assignee: nobody → Darragh Bailey (dbailey-k)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to git-upstream (master)

Fix proposed to branch: master

Changed in git-upstream:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to git-upstream (master)

Submitter: Jenkins
Branch: master

commit 5c0a4a7e4d56a8301e7391abf0bb79d387a98ae1
Author: Darragh Bailey <email address hidden>
Date: Mon Oct 17 11:26:44 2016 +0100

    Remove compatibility hacks causing issues with newer GitPython

    Remove some monkey patching used to allow git-upstream to work with
    GitPython releases older than 0.3.2, as the project requirements now
    depends on 1.0.1 or newer.

    GitPython release from 2.0.9 onwards removes the '__slots__'
    definition. This allowed for the git_dir attribute existence to be
    checked to determine whether to patch the Commit class imported from
    the GitPython project to add this attribute for older versions of the

    Change-Id: I3d83785b16cd0650942c7112b5cafffc21dddba7
    Closes-Bug: #1634053

Changed in git-upstream:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.