[issue27528] Document that filterwarnings(message=...) matches the start of a message
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
New submission from Martin Panter: I assumed that the “message” parameter could be used to match any substring of a warning message, but it turns out it calls regex.match(), which is anchored at the beginning of the search string (but is not anchored at the end). I propose this patch to clarify the documentation, and add some tests. ---------- assignee: docs@python components: Documentation files: match-start.patch keywords: patch messages: 270546 nosy: docs@python, martin.panter priority: normal severity: normal stage: patch review status: open title: Document that filterwarnings(message=...) matches the start of a message versions: Python 2.7, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file43744/match-start.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27528> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Roundup Robot added the comment: New changeset 739f638bb9f8 by Martin Panter in branch '2.7': Issue #27528: Document and test warning messages must match at beginning https://hg.python.org/cpython/rev/739f638bb9f8 New changeset 7571432200a2 by Martin Panter in branch '3.5': Issue #27528: Document and test warning messages must match at beginning https://hg.python.org/cpython/rev/7571432200a2 New changeset e0761e817deb by Martin Panter in branch 'default': Issue #27528: Merge warning doc and test from 3.5 https://hg.python.org/cpython/rev/e0761e817deb ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27528> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Changes by Martin Panter <vadmium+py@gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27528> _______________________________________
participants (2)
-
Martin Panter
-
Roundup Robot