You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
robotparser do not allow some url which are allowed #110333
I was using robotparser to check some websites and I realized that the there was a strange behavior. I gave it some urls that I knew could be crawled and it return me False. After some debugging I realize that the url was ok but I think there is a problem in the function that is reading the url.
The robotparser module is old, it is based on the pre-standard document http://www.robotstxt.org/orig.html. It does not support all features of RFC 9309, which was only published in 2022. In particularly, it does not support the $ special character.
So, this is a request for a new feature. Unfortunately, the full support of RFC 9309 requires changing the internal structure of the module.
"Unavailable" means the crawler tries to fetch the robots.txt file and the server responds with status codes indicating that the resource in question is unavailable. For example, in the context of HTTP, such status codes are in the 400-499 range.
If a server status code indicates that the robots.txt file is unavailable to the crawler, then the crawler MAY access any resources on the server.
The robotparser implementation treats status codes 401 and 403 as "all disallowe" (it was so from beginning). It MAY treat them as "all allowed", but the current behavior does not violate RFC 9309. We can add an option to allow full access in such cases if there are good reasons to keep the current behavior.
Activity
sobolevn commentedon Oct 4, 2023
Can you please provide a URL to reproduce this locally?
FedeGerva commentedon Oct 4, 2023
Yes, sure. here my code.
If I try it using the original function it returns
False. If I add the header (see above) it returnTrueserhiy-storchaka commentedon Sep 4, 2025
The
robotparsermodule is old, it is based on the pre-standard document http://www.robotstxt.org/orig.html. It does not support all features of RFC 9309, which was only published in 2022. In particularly, it does not support the$special character.So, this is a request for a new feature. Unfortunately, the full support of RFC 9309 requires changing the internal structure of the module.
serhiy-storchaka commentedon May 4, 2026
In RFC 9309:
The
robotparserimplementation treats status codes 401 and 403 as "all disallowe" (it was so from beginning). It MAY treat them as "all allowed", but the current behavior does not violate RFC 9309. We can add an option to allow full access in such cases if there are good reasons to keep the current behavior.orsenthil commentedon Jul 5, 2026
Addressed here #103753