Author ncoghlan
Recipients barry, benjamin.peterson, brett.cannon, exarkun, ncoghlan, pitrou
Date 2008-09-09.13:11:39
SpamBayes Score 6.72984e-12
Marked as misclassified No
Message-id <1220965961.37.0.869815222283.issue3781@psf.upfronthosting.co.za>
In-reply-to
Content
It turns out the warnings.catch_warnings version has re-entrancy issues
due to the fact that it can't use @contextmanager:

Python 2.6b3+ (trunk:66143M, Sep  2 2008, 20:04:43)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> orig_filters = warnings.filters
>>> cw = warnings.catch_warnings()
>>> with cw:
...   warnings.filters = []
...   with cw:
...     pass
...
>>> warnings.filters is orig_filters
False
>>> warnings.filters
[]
>>> orig_filters
[('ignore', None, <type 'exceptions.PendingDeprecationWarning'>, None,
0), ('ignore', None, <type 'exceptions.ImportWarning'>, None, 0),
('ignore', None, <type 'exceptions.BytesWarning'>, None, 0)]

I propose that we just revert to the test.test_support.catch_warnings
implementation that was used in the beta releases, and leave the
question of whether to expose this ability somewhere other than our own
regression test support module for 2.7/3.1. That version worked, and the
attempt to move it at the last minute has caused nothing but trouble.

So on trunk we would revert the following checkins:
r66135 (relocate to warnings and change API)
r66321 (change API again in attempt to fix bugs in r66135)

And on the py3k branch we would revert:
r66139 (merge r66135)
r66322* (merge r66322)

*This commit actually appears to have missed the changes to
test.test_support that were in r66321 - test.support was not modified by
the r66322 checkin (which strikes me as all the more reason to revert
all of these changes and go back to the beta implementation)
History
Date User Action Args
2008-09-09 13:12:41ncoghlansetrecipients: + ncoghlan, barry, brett.cannon, exarkun, pitrou, benjamin.peterson
2008-09-09 13:12:41ncoghlansetmessageid: <1220965961.37.0.869815222283.issue3781@psf.upfronthosting.co.za>
2008-09-09 13:11:40ncoghlanlinkissue3781 messages
2008-09-09 13:11:39ncoghlancreate