api.repos.create_fork not finding repo but curl command working
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với lời gọi trong scripts/e2e/main.py và lần theo nó qua ghapi/core.py và fastcore/net.py, đồng thời so sánh request được tạo ra với request curl đang hoạt động tới endpoint forks của GitHub. Hoàn tất khi đã xác định được lý do hai request khác nhau và đã ghi lại hoặc sửa hành vi để lời gọi Python thành công đối với repository này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Python
- Star
- 687
- Fork
- 69
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AnswerDotAI/ghapi
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
AnswerDotAI/ghapi#158 ·
-
Small fix needed to enable GHES Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AnswerDotAI/ghapi#120 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
AnswerDotAI/ghapi#208 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
AnswerDotAI/ghapi#201 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
AnswerDotAI/ghapi#186 ·
Tất cả issue của AnswerDotAI/ghapi
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
huggingface/Repo2RLEnv#163 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NousResearch/hermes-agent#121143 ·