Message56291
I figured out why the tests are all failing; the C code does not call
back into the Python 'warnings' wrapper.
For instance, warn_explicit in the C code does not ever try to use a
user-provided showwarning() function. This causes the tests to fail as
they rely on this functionality.
There is also the issue of the filters and once_registry also only be
referenced in the C code and not in the Python code. So while the list
and dict, respectively, are assigned in warnings.py from _warnings.c,
the C code never checks to see if the attributes in the Python code were
changed. This is an issue as a lot of times code does::
warnings.filter = []
... code ...
warnings.filter = original_filter
That will not work with how it is implemented now as the C code only
works off of the object it created and never one that a user may have
provided.
Could a descriptor be written so that when the Python code has the
filter, once_registry, or showwarnings set it actually gets set in the C
code? That way the C code can continue to be fully independent of the
Python code and not have to import it unless a specific change was
attempted upon 'warnings'? |
|
Date |
User |
Action |
Args |
2007-10-09 19:53:18 | brett.cannon | set | spambayes_score: 0.00587996 -> 0.00587996 recipients:
+ brett.cannon, nnorwitz |
2007-10-09 19:53:18 | brett.cannon | set | spambayes_score: 0.00587996 -> 0.00587996 messageid: <1191959598.03.0.105570448043.issue1631171@psf.upfronthosting.co.za> |
2007-10-09 19:53:18 | brett.cannon | link | issue1631171 messages |
2007-10-09 19:53:17 | brett.cannon | create | |
|