pythongitzilla

Gitzilla: missing python http.cookiejar module


I am trying to get gitzilla to work for me on ubuntu 14.04 with python 2.7.6 and git 1.9.1. This is my first time using either python or gitzilla.

After installing gitzilla and adding the symlinks for git hooks, pushing changes gives the following output:

geoff@jenkins:~/Example$ git push origin master
Counting objects: 5, done.
Writing objects: 100% (3/3), 282 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Traceback (most recent call last):
remote:   File "hooks/update", line 9, in <module>
remote:     load_entry_point('gitzilla==2.0', 'console_scripts', 'gitzilla-update')()
remote:   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
remote:     return get_distribution(dist).load_entry_point(group, name)
remote:   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
remote:     return ep.load()
remote:   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
remote:     entry = __import__(self.module_name, globals(),globals(), ['__name__'])
remote:   File "build/bdist.linux-x86_64/egg/gitzilla/hookscripts.py", line 11, in <module>
remote:   File "build/bdist.linux-x86_64/egg/gitzilla/hooks.py", line 9, in <module>
remote:   File "build/bdist.linux-x86_64/egg/gitzilla/utils.py", line 10, in <module>
remote:   File "/usr/local/lib/python2.7/dist-packages/bugz/bugzilla.py", line 7, in <module>
remote:     import http.cookiejar
remote: ImportError: No module named http.cookiejar
remote: error: hook declined to update refs/heads/master
To /home/geoff/gitrepos/Example.git/
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/home/geoff/gitrepos/Example.git/'

From this I figure I need http.cookiejar (or cookielib) installed but I don't know how to get it.

I've tried without success: pip install http.cookiejar and pip install cookielib

Both times pip complained about not finding anything but then I tried pip install cookiejar which did appear to install it, but I still get the same error pip install cookiejar

Now this runs without complaint: python -c "import cookiejar"

And this complains the module isn't found: python -c "import http.cookiejar"

Any ideas how to get this working?


Solution

  • Alexander's comment pointed out the problem (almost 3 years ago) which led to the answer shown in the comments to the question. As seen in the comments, it was a mixup between packages from python2.7 and python3. If you came here looking to resolve the same actual problem with gitzilla, the patch has been entered back into the master branch now so please use a recent version or the one I linked to in my comments above.

    I'm adding this to close the question to stop answer spamming.