-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
urllib.robotparser doesn't treat the "*" path correctly #114310
Copy link
Copy link
Open
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-featureA feature request or enhancementA feature request or enhancement
Bug report
Bug description:
https://github.com/python/cpython/blob/3.12/Lib/urllib/robotparser.py#L227
self.path == "*"will never betruebecause of this line:https://github.com/python/cpython/blob/3.12/Lib/urllib/robotparser.py#L114
That converts the
*character to%2AProposed solution
Change in line 227
self.path == "*"toself.path == "%2A"CPython versions tested on:
3.12, 3.13, CPython main branch
Operating systems tested on:
Linux