【发布时间】:2022-10-06 04:11:33
【问题描述】:
我正在将一些 python2 代码移植到 python3 - 单一代码库。我在 cpython 2.7 上使用 pygit2 0.28.2,在 cpython3.10 上使用 pygit2 1.9.2,至少现在是这样。
我收到一个错误 (-3) 来自:
err = C.git_remote_push(self._remote, refspecs, opts)
...并且 payload.check_error(err) 将其映射到:
KeyError: \'the requested type does not match the type in the ODB\'
该错误仅出现在 cpython3.10 上,而不是 cpython2.7 上。
恐怕我不知道该怎么做。我用谷歌搜索了大约 90 分钟,并没有找到太多。
这是完整的追溯:
Traceback (most recent call last):
File \"/app/shared/common/git/handlers.py\", line 488, in Push
remote.push(temp3, callbacks=self.callbacks)
File \"/usr/local/lib/python3.10/site-packages/pygit2/remote.py\", line 257, in push
payload.check_error(err)
File \"/usr/local/lib/python3.10/site-packages/pygit2/callbacks.py\", line 93, in check_error
check_error(error_code)
File \"/usr/local/lib/python3.10/site-packages/pygit2/errors.py\", line 56, in check_error
raise KeyError(message)\'
KeyError: \'the requested type does not match the type in the ODB\'
任何人都可以在正确的方向上轻推我吗?它抱怨什么类型的?对于 pygit2,传递的数据似乎很不透明。
pygit2 0.28.2 是否有可能总是“强制”,而 pygit2 1.9.2 只会按请求强制?我们在 Python 3 中关闭了 libgit2 的“严格模式”。
谢谢!