Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning filter message/module documentation is misleading #86438

Closed
kevinoid mannequin opened this issue Nov 5, 2020 · 4 comments
Closed

Warning filter message/module documentation is misleading #86438

kevinoid mannequin opened this issue Nov 5, 2020 · 4 comments
Assignees
Labels
3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@kevinoid
Copy link
Mannequin

kevinoid mannequin commented Nov 5, 2020

BPO 42272
Nosy @kevinoid
PRs
  • bpo-42272: fix misleading warning filter message/module docs #23172
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-11-05.20:06:37.165>
    labels = ['type-feature', '3.10', 'docs']
    title = 'Warning filter message/module documentation is misleading'
    updated_at = <Date 2021-08-28.08:27:10.953>
    user = 'https://github.com/kevinoid'

    bugs.python.org fields:

    activity = <Date 2021-08-28.08:27:10.953>
    actor = 'ananyadatta88'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2020-11-05.20:06:37.165>
    creator = 'kevinoid'
    dependencies = []
    files = ['50238']
    hgrepos = []
    issue_num = 42272
    keywords = ['patch']
    message_count = 2.0
    messages = ['380429', '400464']
    nosy_count = 3.0
    nosy_names = ['docs@python', 'kevinoid', 'ananyadatta88']
    pr_nums = ['23172']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42272'
    versions = ['Python 3.10']

    @kevinoid
    Copy link
    Mannequin Author

    kevinoid mannequin commented Nov 5, 2020

    "The Warnings Filter" section of the documentation for the warnings module describes the message and module filters as "a string containing a regular expression". While that is true when they are arguments to the filterwarnings function, it is not true when they appear in -W or $PYTHONWARNINGS where they are matched literally (after stripping any starting/ending whitespace).

    Additionally, in the "Describing Warning Filters" section, the example "error:::mymodule[.*]" does not behave as described. If it were used as an argument to filterwarnings, where it would be treated as a regular expression, it would match the (invalid) module names mymodule. or mymodule* while it would match mymodule[.*] literally if passed via -W or $PYTHONWARNINGS.

    @kevinoid kevinoid mannequin added the 3.10 only security fixes label Nov 5, 2020
    @kevinoid kevinoid mannequin assigned docspython Nov 5, 2020
    @kevinoid kevinoid mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Nov 5, 2020
    @ananyadatta88
    Copy link
    Mannequin

    ananyadatta88 mannequin commented Aug 28, 2021

    No comments

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @ezio-melotti ezio-melotti self-assigned this May 25, 2022
    @ezio-melotti
    Copy link
    Member

    ezio-melotti commented May 30, 2022

    Fixed in GH-23172, backported in GH-93342 and GH-93341. Thanks for the report and the PR!

    @kevinoid
    Copy link
    Contributor

    Thanks for reviewing and merging it @ezio-melotti!

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants