ghapi.page.paged does not respect rate limits
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the ghapi.page.paged entry point and the request flow shown in ghapi/core.py, then inspect fastcore/net.py where HTTP errors are raised. Reproduce the search.code example and trace the rate-limit headers and pagination behavior. Done means the example can paginate without repeatedly receiving HTTP 403 responses while respecting the reported rate limits.
Written by the indexing model from the issue text.
Description
Calling it almost always results in HTTP403ForbiddenError: HTTP Error 403: Forbidden
for result in ghapi.page.paged(gh_api.search.code, q=f"filename:component.yaml repo:Ark-kun/pipeline_components"):
print(len(result["items"]))
opt/conda/lib/python3.7/site-packages/ghapi/core.py in __call__(self, path, verb, headers, route, query, data)
107 for k,v in route.items(): route[k] = quote(str(route[k]))
108 res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
--> 109 route=route or None, query=query or None, data=data or None)
110 if 'X-RateLimit-Remaining' in self.recv_hdrs:
111 newlim = self.recv_hdrs['X-RateLimit-Remaining']
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlsend(url, verb, headers, route, query, data, json_data, return_json, return_headers, debug)
210 return urlread(req, decode=False, return_json=False, return_headers=return_headers)
211
--> 212 return urlread(req, return_json=return_json, return_headers=return_headers)
213
214 # Cell
/opt/conda/lib/python3.7/site-packages/fastcore/net.py in urlread(url, data, headers, decode, return_json, return_headers, timeout, **kwargs)
111 with urlopen(url, data=data, headers=headers, timeout=timeout, **kwargs) as u: res,hdrs = u.read(),u.headers
112 except HTTPError as e:
--> 113 if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None
114 else: raise
115
HTTP403ForbiddenError: HTTP Error 403: Forbidden
- Dominant language
- Python
- Stars
- 687
- Forks
- 69
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AnswerDotAI/ghapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AnswerDotAI/ghapi#158 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AnswerDotAI/ghapi#120 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
AnswerDotAI/ghapi#208 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
AnswerDotAI/ghapi#201 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
AnswerDotAI/ghapi#186 ·
All issues in AnswerDotAI/ghapi
Similar issues
-
area: harness bug status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Human-Agent-Society/reef#625 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
learningequality/kolibri#15351 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Name consistency Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
eellak/triplestore#65 · 1 comment ·