Skip to content

Release 1.5.6: robots.txt fail-closed, offset pagination, save() mkdir - #159

Merged
vedaant00 merged 2 commits into
mainfrom
vs-001
Aug 19, 2026
Merged

Release 1.5.6: robots.txt fail-closed, offset pagination, save() mkdir#159
vedaant00 merged 2 commits into
mainfrom
vs-001

Conversation

@vedaant00

Copy link
Copy Markdown
Collaborator

Summary

Release 1.5.6. Bundles the robots.txt server-error fix (#152) with two
contributor fixes already merged to main (#151, #150), and bumps the version
across all sites.

Changes

Fixed

  • robots.txt server errors now fail closed (robots.txt: server errors (5xx) are treated as allow-all instead of disallow-all #152). A 5xx (or a connection
    error / timeout) while fetching robots.txt was parsed as an empty allow-all
    body and cached for the session, so a site whose robots.txt was temporarily
    500ing got crawled as if unrestricted. The fetch now uses get_raw so the real
    status code is visible, and handling is split by class per RFC 9309 / Googlebot:
    2xx uses the rules, 4xx is allow-all (both cacheable), and 5xx / network
    errors fail closed with a disallow-all parser that is not cached, so the
    next request re-fetches. Sync and async share one decision helper.
  • Offset-based pagination advances by the page size, not by 1 (Offset-based pagination (offset=/start=) advances by 1 instead of the page size #151). For
    offset=/start= URLs, find_next_page_url infers the step from the gaps
    between the page links (e.g. 0/20/40/60+20) instead of +1, which
    silently under-collected on offset-paginated sites. page/p URLs still
    advance by 1.
  • ScrapeResult.save() creates parent directories (save() fails when the target directory does not exist #150). Saving to a path
    whose directory does not exist (e.g. out/nested/data.json) now creates the
    tree instead of raising FileNotFoundError.

Chore

  • Bump to 1.5.6 across pyproject.toml, __init__.py, and server.json; update
    CHANGELOG.

Testing

Closes #152.

A 5xx or a network error while fetching robots.txt was parsed as an empty
(allow-all) body and cached for the session, so a site whose robots.txt was
temporarily 500ing got crawled as if unrestricted — the exact failure robots
handling should prevent.

Now the fetch uses get_raw so the real status code is visible, and a helper
splits handling by class per RFC 9309 / Googlebot: 2xx uses the rules, 4xx is
allow-all (both cacheable), 5xx (and network errors) fail closed with a
disallow-all parser that is NOT cached, so the next request re-fetches. Sync
and async share the same decision helper.
@vedaant00
vedaant00 merged commit b5ce767 into main Aug 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

robots.txt: server errors (5xx) are treated as allow-all instead of disallow-all

1 participant