Skip to content

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

Open
@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

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtriagedThe issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or errortype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions