api.repos.create_fork not finding repo but curl command working
还没有人认领这个 Issue。
评估
调研方向
从 scripts/e2e/main.py 中的调用开始,跟踪它经过 ghapi/core.py 和 fastcore/net.py 的过程,并将生成的请求与发送到 GitHub forks 端点且能够正常工作的 curl 请求进行比较。完成的标准是确定两个请求存在差异的原因,并记录或修正相关行为,使 Python 调用能够针对该 repository 成功执行。
由索引模型根据 Issue 内容生成。
描述
I ran api.repos.create_fork(owner="WebGoat", repo="WebGoat"), and got an error:
Traceback (most recent call last):
File "/Users/iulspop/Development/github-app/scripts/e2e/main.py", line 15, in <module>
api.repos.create_fork(owner="WebGoat", repo="WebGoat")
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ghapi/core.py", line 61, in __call__
return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ghapi/core.py", line 120, in __call__
res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=debug, return_headers=True,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fastcore/net.py", line 218, in urlsend
return urlread(req, return_json=return_json, return_headers=return_headers)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fastcore/net.py", line 119, in urlread
if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp, msg=e.msg) from None
fastcore.net.HTTP404NotFoundError: HTTP Error 404: Not Found
====Error Body====
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-fork"
}
But when I run the curl command directly:
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer X" \
https://api.github.com/repos/WebGoat/WebGoat/forks
It just works.
Any ideas why the ghapi isn't working here?
- 主要语言
- Python
- 星标
- 687
- 派生
- 69
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AnswerDotAI/ghapi 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
AnswerDotAI/ghapi#158 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
AnswerDotAI/ghapi#120 ·
-
难度 2/5 1-3 小时 新手友好度 58/100
AnswerDotAI/ghapi#208 ·
-
难度 4/5 3-5 天 新手友好度 42/100
AnswerDotAI/ghapi#201 ·
-
难度 3/5 1-2 天 新手友好度 35/100
AnswerDotAI/ghapi#186 ·
查看 AnswerDotAI/ghapi 的全部 Issue
相似的 Issue
-
SSM GetParameter throttling during concurrent workflow launches可能已有人在做 @alexiswl 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
-
[Bug] Dev image build fails: `npm install` in the root Dockerfile runs out of memory (exit 134)可能已有人在做 @andest01 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Rename FunctionalRole BOT_DEV to DEV_STAFF可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 79/100
pesu-dev/discord_bot#97 ·
-
难度 1/5 1-3 小时 新手友好度 88/100
gradio-app/gradio#13964 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 93/100
BSData/horus-heresy-3rd-edition#3232 · 1 条评论 ·
维护者通常 1 天内回复