Title: bpo-42272: fix misleading warning filter message/module docs by kevinoid · Pull Request #23172 · python/cpython · GitHub
Open Graph Title: bpo-42272: fix misleading warning filter message/module docs by kevinoid · Pull Request #23172 · python/cpython
X Title: bpo-42272: fix misleading warning filter message/module docs by kevinoid · Pull Request #23172 · python/cpython
Description: "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 orPYTHONWARNINGS where they are matched literally (after stripping any starting/ending whitespace). This PR updates the documentation to note when they are matched literally and clarifies that module matches the "fully-qualified module name", rather than "module name" which is ambiguous. Additionally, 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, this PR updates the filter and comment to match only "mymodule". Thanks for considering, Kevin https://bugs.python.org/issue42272
Open Graph Description: "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 wh...
X Description: "The Warnings Filter" section of the warnings module documentation describes the message and module filters as "a string containing a regular expression". While...
Opengraph URL: https://github.com/python/cpython/pull/23172
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c2ca4078-3748-d885-8086-46100a9c9273 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DF56:3A96BF:5185EE:6DE4FD:6A53EA3D |
| html-safe-nonce | 7024eb0d8f6fb8bc6a488594d1b6412df0a56334ba8f635f47b506876c2b6e3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjU2OjNBOTZCRjo1MTg1RUU6NkRFNEZEOjZBNTNFQTNEIiwidmlzaXRvcl9pZCI6IjMzMzg2MzUyNjM4ODI4MTYwNjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3b806d3045c271d216d8db4c25c9f99b737fd4de45d93e60801a295a426e72ee |
| hovercard-subject-tag | pull_request:516311793 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/23172/files |
| twitter:image | https://avatars.githubusercontent.com/u/336433?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336433?s=400&v=4 |
| og:image:alt | "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 wh... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width