This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kevinoid
Recipients docs@python, kevinoid
Date 2020-11-05.20:06:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
"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.
History
Date User Action Args
2020-11-05 20:06:37kevinoidsetrecipients: + kevinoid, docs@python
2020-11-05 20:06:37kevinoidsetmessageid: <[email protected]>
2020-11-05 20:06:37kevinoidlinkissue42272 messages
2020-11-05 20:06:36kevinoidcreate