ai didi

python - Gittle - "unexpected keyword argument ' pkey'”

转载 作者:太空狗 更新时间:2023-10-30 01:15:22 24 4
gpt4 key购买 nike

我正在尝试使用库 gittle 来克隆一个 git 存储库,我遵循了自述文件中的示例,这是我的代码。

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)

当我尝试运行它时,我得到了这个异常:

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'

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

谢谢。

最佳答案

这是在 github as TypeError: init() got an unexpected keyword argument 'pkey' 提交的问题

那里也描述了解决方法 - 使用 dulwich 的一些克隆版本

关于python - Gittle - "unexpected keyword argument ' pkey'”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22175245/

24 4 0
文章推荐: c# - 拉动刷新 UWP - GridView ?
文章推荐: c# - 如何优化读取访问?
文章推荐: c# - 无法在设计时编辑 Point[] 或 List
文章推荐: python - 如何在不使用 Python 中的外部库的情况下解析 arff 文件
太空狗
个人简介

我是一名优秀的程序员,十分优秀!

滴滴打车优惠券免费领取
滴滴打车优惠券
全站热门文章
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com