pygit2.GitError: failed to parse supported auth schemes: The operation identifier is not valid.
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 408
- 平均合并
- 2 天 57 分钟
- 30 天内合并 PR
- 7
描述
I am trying to clone private github repository using pygit2 module but getting the below error.
Traceback (most recent call last):
File ".\test2.py", line 29, in <module>
repoClone = pygit2.clone_repository(repo_from_template.clone_url, 'C://TestRepo', callbacks=callbacks)
File "C:\Anaconda3\lib\site-packages\pygit2\__init__.py", line 222, in clone_repository
payload.check_error(err)
File "C:\Anaconda3\lib\site-packages\pygit2\callbacks.py", line 93, in check_error
check_error(error_code)
File "C:\Anaconda3\lib\site-packages\pygit2\errors.py", line 65, in check_error
raise GitError(message)
_pygit2.GitError: failed to parse supported auth schemes: The operation identifier is not valid.
Below is the source code I am using
import pygit2
import config_
from github import Github
g = Github(<personal access token>,base_url='https://api.github.com')
github_user = g.get_user()
org = g.get_organization(<org-name>)
repo_from_template=org.create_repo(name='TestRepo',private=True)
credentials = pygit2.UserPass(github_user.login, <personal access token>)
callbacks = pygit2.RemoteCallbacks(credentials=credentials)
repoClone = pygit2.clone_repository(repo_from_template.clone_url, 'C://TestRepo', callbacks=callbacks)
I am using python 3.9 and have tried pygit2 version 1.10.1 and 1.12.0 and both are giving the same error.
Are there any changes made to the callbacks recently which is creating this issue?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在 Python 3.9 上,使用 RemoteCallbacks 和 UserPass 凭据针对私有 GitHub 仓库复现 issue 中 clone_repository 调用的失败,并测试 pygit2 1.10.1 和 1.12.0。跟踪 traceback 指出的 callback 和身份验证路径;在确定原因且私有仓库克隆成功,或明确记录不兼容性时完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, github, python
- 领域
- authentication, devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100