AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 408
- 平均合并
- 2 天 57 分钟
- 30 天内合并 PR
- 7
描述
I've installed using pip install pygit2==1.12.1. The environment is a python:3.10 docker container.
I'm receiving:
Traceback (most recent call last):
...
File "...", line 197, in pull_repo
remote.save()
File "/app/env/lib/python3.10/site-packages/pygit2/remote.py", line 117, in save
err = C.git_remote_save(self._remote)
AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'. Did you mean: 'git_remote_name'?
The relevant code associated with this error is as follows:
repo = pygit2.Repository(checkout_location)
remote = repo.remotes['origin']
remote.fetch(callbacks=callbacks)
remote.save()
I attempted to use the Remote.save method because the call to Remote.fetch didn't appear to do anything to the repository, which is known to have changed.
Note, I could be using this all wrong, but I would still think an AttributeError shouldn't be raised. Also, there isn't a good example or clear way to do the equivalent of a git pull, which is why I'm fiddling with fetching the remote in order to advance the index.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在使用 pygit2==1.12.1 的 python:3.10 容器中重现 traceback,然后检查 pygit2/remote.py 中 Remote.save 附近的代码以及随附的 libgit2 绑定。检查预期 Remote.fetch 应如何更新 repository 状态,以及文档所述的工作流是否会避开这个缺失的符号;当所报告的操作不再引发 AttributeError,且其行为已得到覆盖或有明确文档说明时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, python
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100