[Python-Dev] 'warnings' module changes still breaking Twisted, still looking for a fix

Brett Cannon brett at python.org
Fri Sep 5 00:35:33 CEST 2008


On Thu, Sep 4, 2008 at 3:11 PM,  <glyph at divmod.com> wrote:
>
> With the 2.6 final release impending, the Twisted community buildbot is
> still red, <http://bit.ly/zFymN>, but there only seems to be one real issue:
> the warn_explicit change.  This seems like it could be a pretty minor bit of
> maintenance to clear up on our end, if Python provided the appropriate hook.
>
> The current solution we have in mind for this problem is to build our own
> warnings module <http://bit.ly/4F3Qr2>, but that is obviously inelegant.

And possibly unnecessary if you just want the old pure Python
implementation for testing. It is not hard to force an import of
warnings to use the pure Python version and totally ignore the C
implementation. See test_warnings on how to pull that off. Then you
can do your hack of overriding warn_explicit().

>  While we do want to experiment with our own features for deprecation, users
> of Twisted will (rightfully) expect our "assertWarns" to continue covering
> warnings produced by the Python 2.6 warnings system.
>
> The proposed solution to this problem seems to have been
> "warnings.catch_warnings()" <http://bugs.python.org/issue3602>, but it is
> insufficient for testing, since subsequent calls to "catch_warnings()" will
> not catch warnings suppressed by duplication suppression; without even
> getting into multiple tests testing the same code path, this breaks features
> like our 'trial' tool's "--until- failure" option, which runs a fixed group
> of tests repeatedly in an attempt to flush out buggy tests which have race
> conditions that cause them to fail intermittently.
>
> We thought we'd filed a ticket for this before, but searching around in the
> issue tracker hasn't come up with anything.  JP Calderone has filed a new
> ticket for this problem: <http://bugs.python.org/issue3780> .

I am going to discuss technicalities on the issue.

-Brett


More information about the Python-Dev mailing list