Message301867
The following code causes an assertion failure in warn_explicit() (in
Python/_warnings.c):
import warnings
warnings.filters = [(None, None, Warning, None, 0)]
warnings.warn_explicit(message='foo', category=Warning, filename='bar',
lineno=1)
this is because warn_explicit() assumes that get_filter() returned a string,
and passes the return value (of get_filter()) to _PyUnicode_EqualToASCIIString(),
which asserts it received a string.
In addition, get_filter() might return warnings.defaultaction, and so the
following code also causes an assertion failure in warn_explicit():
import warnings
warnings.defaultaction = None
warnings.filters = []
warnings.warn_explicit(message='foo', category=Warning, filename='bar',
lineno=1) |
|
Date |
User |
Action |
Args |
2017-09-11 07:52:58 | Oren Milman | set | recipients:
+ Oren Milman |
2017-09-11 07:52:58 | Oren Milman | set | messageid: <1505116378.77.0.852325639547.issue31416@psf.upfronthosting.co.za> |
2017-09-11 07:52:58 | Oren Milman | link | issue31416 messages |
2017-09-11 07:52:58 | Oren Milman | create | |
|