Parse only the query string for PaginatedList.totalCount (#3518)
`PaginatedList` computed `totalCount` with `parse_qs(lastUrl)["page"][0]`, passing the whole URL to `parse_qs`. `parse_qs` expects only a query string, so it splits the entire URL and the first parameter's key ends up prefixed with the scheme/host/path. This only worked because GitHub conventionally puts `page` last in the `rel="last"` link. When `page` comes first (e.g. `...?page=42&per_page=1`), `["page"]` raises `KeyError`. The fix uses `Requester.get_parameters_of_url`, which extracts the query string before `parse_qs` and is already used by the sibling pagination code in the same file. Added `testTotalCountWithLastPageAndPageFirst` with a replay fixture whose `rel="last"` link lists `page` first. It raises `KeyError` on the current code and passes with the change; the full `tests/PaginatedList.py` suite passes. Co-authored-by: Noethix55555 <277300782+Noethix55555@users.noreply.github.com>
N
Noethix committed
645d2a2e83e7936712cc55a403013659f7528579
Parent: a7ff0c0
Committed by GitHub <noreply@github.com>
on 6/16/2026, 8:01:24 AM