Metikha Metikha - 2 months ago 6
Git Question

Gittle - "unexpected keyword argument 'pkey'"

I'm trying to use the library gittle to clone a git repository, I followed the examples in the readme, here is my code.

repo_path = '/path/to/dir/'
repo_url = 'git@gitlab.myproject/proj.git'
key = open('/path/to/.ssh/id_rsa')
auth = GittleAuth(pkey=key)
repo = Gittle.clone(repo_url, repo_path, auth=auth)


When I try to run this, I got this exception:

Traceback (most recent call last):
File "gitCmd2.py", line 26, in <module>
gitinit()
File "gitCmd2.py", line 11, in gitinit
repo = Gittle.clone(repo_url, repo_path, auth=auth)
File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 439, in clone
repo.fetch(bare=bare)
File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 406, in fetch
remote_refs = self.fetch_remote(origin_uri)
File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 363, in fetch_remote
client, remote_path = self.get_client(origin_uri=origin_uri)
File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/gittle/gittle.py", line 327, in get_client
client, remote_path = get_transport_and_path(origin_uri, **client_kwargs)
File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/dulwich/client.py", line 1076, in get_transport_and_path
return SSHGitClient(host, username=user, **kwargs), path
File "/.virtualenvs/test_gittle/lib/python2.7/site-packages/dulwich/client.py", line 879, in __init__
TraditionalGitClient.__init__(self, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'pkey'


The result of pip freeze (python2.7):

dulwich==0.9.5
funky==0.0.2
gittle==0.3.0
mimer==0.0.1
paramiko==1.10.0
pycrypto==2.6
wsgiref==0.1.2


Thank you.

Answer

This is issue filed at github as TypeError: init() got an unexpected keyword argument 'pkey'

Workaround is described there too - using some cloned version of dulwich

Comments