api.repos.create_fork not finding repo but curl command working
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia dalla chiamata in scripts/e2e/main.py e seguila attraverso ghapi/core.py e fastcore/net.py, confrontando la richiesta generata con la richiesta curl funzionante all’endpoint dei fork di GitHub. Il lavoro è completato quando è stato identificato il motivo per cui le due richieste differiscono e il comportamento è stato documentato o corretto in modo che la chiamata Python abbia esito positivo per questo repository.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- Python
- Stelle
- 687
- Fork
- 69
- Merge medio
- 1m
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AnswerDotAI/ghapi
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
AnswerDotAI/ghapi#158 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AnswerDotAI/ghapi#120 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
AnswerDotAI/ghapi#208 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
AnswerDotAI/ghapi#201 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
AnswerDotAI/ghapi#186 ·
Tutte le issue di AnswerDotAI/ghapi
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·