diff options
author | Kevin Locke <kevin@kevinlocke.name> | 2022-05-30 01:43:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-30 01:43:32 (GMT) |
commit | 8136606769661c103c46d142e52ecbbbb88803f6 (patch) | |
tree | 9c4c80a0b9f3ead173c3a28be77512b194de3f94 /Misc/NEWS.d/3.8.0a3.rst | |
parent | 4f195f9db168bfe3360607eb45ba8d9ac98506ec (diff) | |
download | cpython-8136606769661c103c46d142e52ecbbbb88803f6.zip cpython-8136606769661c103c46d142e52ecbbbb88803f6.tar.gz cpython-8136606769661c103c46d142e52ecbbbb88803f6.tar.bz2 |
bpo-42272: fix misleading warning filter message/module docs (#23172)
* bpo-42272: improve message/module warning filter docs
"The Warnings Filter" section of the warnings module documentation
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). Update the documentation to note when they
are matched literally. Also clarify that module matches the
"fully-qualified module name", rather than "module name" which is
ambiguous.
skip news (since this is a doc fix)
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* bpo-42272: remove bad submodule warning filter doc
The `error:::mymodule[.*]` example in the "Describing Warning Filters"
section of the warnings module documentation does not behave as the
comment describes. Since the module portion of the filter string is
interpreted literally, it would match a module with a fully-qualified
name that is literally `mymodule[.*]`.
Unfortunately, there is not a way to match '"module" and any subpackages
of "mymodule"' as documented, since the module part of a filter string
is matched literally. Instead, update the filter and comment to match
only "mymodule".
skip news (since this is a doc fix)
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* bpo-42272: add warning filter doc changes to NEWS
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Diffstat (limited to 'Misc/NEWS.d/3.8.0a3.rst')
0 files changed, 0 insertions, 0 deletions