Skip to content

urllib.robotparser doesn't treat the "*" path correctly #114310

@tognee

Description

@tognee

Bug report

Bug description:

https://github.com/python/cpython/blob/3.12/Lib/urllib/robotparser.py#L227

self.path == "*" will never be true because of this line:

https://github.com/python/cpython/blob/3.12/Lib/urllib/robotparser.py#L114

That converts the * character to %2A

Proposed solution

Change in line 227 self.path == "*" to self.path == "%2A"

CPython versions tested on:

3.12, 3.13, CPython main branch

Operating systems tested on:

Linux

Metadata

Metadata

Labels

3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytriagedThe issue has been accepted as valid by a triager.type-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions