Title: warnings.simplefilter should validate input
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.10
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, seberg, vajrasky
Priority: normal Keywords: easy

Created on 2013-01-03 00:42 by seberg, last changed 2021-01-11 23:25 by iritkatriel.

File name Uploaded Description Edit
add_assert_in_simplefilter.patch vajrasky, 2013-10-15 08:58 review
issue16845.diff berker.peksag, 2014-06-24 19:09 review
Messages (3)
msg178867 - (view) Author: Sebastian Berg (seberg) * Date: 2013-01-03 00:42
`warnings.simplefilter` does not validate that the category passed in is actually a class. This means that an invalid category leads to a `TypeError` whenever a warning would otherwise occur due to `issubclass` check failing.

It is a very small thing, but for usability it would be clearer if this was checked right away.
msg199985 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-10-15 08:58
Here is the patch to add the validation in simplefilter with the test.
msg221480 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-06-24 19:09
Here's a patch that uses the same approach as in issue 16382.
Date User Action Args
2021-01-11 23:25:12iritkatrielsetkeywords: + easy, - patch
versions: + Python 3.10, - Python 3.5
2020-03-06 19:40:53brett.cannonsetnosy: - brett.cannon
2014-06-24 19:09:44berker.peksagsetfiles: + issue16845.diff

components: + Library (Lib)
versions: + Python 3.5
nosy: + berker.peksag

messages: + msg221480
stage: patch review
2013-10-15 08:58:30vajraskysetfiles: + add_assert_in_simplefilter.patch

nosy: + vajrasky
messages: + msg199985

keywords: + patch
2013-10-14 14:15:56georg.brandlsetnosy: + brett.cannon
2013-01-03 00:42:06sebergcreate