]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-138907: Support RFC 9309 in robotparser (GH-138908) (GH-149376)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 4 May 2026 18:43:03 +0000 (21:43 +0300)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 18:43:03 +0000 (18:43 +0000)
commit561d1b95b937bd057de431e50aef4188538affc9
tree8217506c78cb2d64c7952cf7e50310a1d0ba1f17
parent38684446008431776819cb78c11f0f01579e24fb
[3.13] gh-138907: Support RFC 9309 in robotparser (GH-138908) (GH-149376)

* empty lines are always ignored instead of separating groups
* the "user-agent" line after a rule starts a new group
* groups matching the same user agent are now merged
* the rule with the longest match wins instead of the first matching rule
* in case of equal matches, the “Allow” rule wins over “Disallow”
* special characters “$” and “*” are now supported in rules
* prefer full match for user agent

(cherry picked from commit bc285e583286c739e553e49c19fd946cb63432c7)
Doc/library/urllib.robotparser.rst
Lib/test/test_robotparser.py
Lib/urllib/robotparser.py
Misc/NEWS.d/next/Library/2026-04-25-14-11-24.gh-issue-138907.u21Wnh.rst [new file with mode: 0644]