#1740 closed defect (invalid)

new zope.interface deprecation warning about "implements()"

Reported by: warner Owned by: davidsarah
Priority: major Milestone: 1.9.2
Component: code Version: 1.9.1
Keywords: zope.interface deprecation warning error Cc:
Launchpad Bug:

Description

One of the buildslaves just started failing tests, here. The tests that assert tahoe start doesn't emit a lot of noise is catching the following deprecation warnings:

src/allmydata/web/directory.py:1113: DeprecationWarning: 
The implements API is deprecated, and will not work in Python3 Use
the @implementer class decorator instead.
  implements(IPushProducer)

My guess is that there's a new version of zope.interface installed on that box, and it's starting to work on py3 compatibility.

We need to find out what versions of zope.interface offer the suggested replacement decorator, decide if we can tolerate being limited to those versions, then update everything (twisted, foolscap, nevow, tahoe) to use the replacement.

In other words, we need to either enforce a older-than dependency restriction to avoid ever using the newer zope.interface, or add a warning-suppression to make this noise go away :-). Actually, that's more like :-(.

Attachments (1)

fix-1740.darcs.patch (106.8 KB) - added by davidsarah at 2012-05-17T01:33:17Z.
Suppress DeprecationWarnings? from zope.interface 4.0.0 about use of 'implements' and 'implementsOnly'. This unifies the handling of all DeprecationWarnings? that need to be suppressed globally. fixes #1740

Download all attachments as: .zip

Change History (6)

comment:1 Changed at 2012-05-17T00:55:03Z by davidsarah

It's not just Tahoe that would have to change every use of 'implements', it's also Nevow, Twisted, and foolscap. I'm for blacklisting this version of zope.interface and telling the zope devs how silly they're being by making this a DeprecationWarning.

comment:2 Changed at 2012-05-17T01:01:47Z by davidsarah

I can reproduce by forcing "zope.interface == 4.0.0" in src/allmydata/_auto_deps.py.

Changed at 2012-05-17T01:33:17Z by davidsarah

Suppress DeprecationWarnings? from zope.interface 4.0.0 about use of 'implements' and 'implementsOnly'. This unifies the handling of all DeprecationWarnings? that need to be suppressed globally. fixes #1740

comment:3 Changed at 2012-05-17T01:34:59Z by davidsarah

  • Keywords zope.interface deprecation warning error review-needed added
  • Milestone changed from undecided to 1.9.2
  • Owner set to warner
  • Priority changed from normal to major

comment:4 Changed at 2012-05-22T23:33:33Z by warner

  • Keywords review-needed removed
  • Owner changed from warner to davidsarah

Looks ok to me. I'd maybe add a note to make it more obvious that the warnings.filters.pop() are supposed to match the warnings.filterwarnings() calls earlier, and that global_deprecation_messages are left in place because the filter list acts like a stack (in particular, if deprecation_messages or global_deprecation_messages were a set instead of a list, it wouldn't work). I might add a comment to that effect myself after it lands.

In the long run, we should pay attention to what our fellow zope.interface-users are doing. If this decorator thing has been around long enough, and it doesn't hurt us otherwise, it might be nice to follow their advice and update the way we use implements.

comment:5 Changed at 2012-05-23T00:04:21Z by warner

  • Resolution set to invalid
  • Status changed from new to closed

Heh, so, I was about to apply this patch, and noticed that the buildslave that was failing because of this warning (in one of the no_noise tests) had spontaneously started passing.

Digging deeper, I learned that sometime in the last two hours, zope.interface-4.0.1 was released, removing the deprecation warnings: http://pypi.python.org/pypi/zope.interface/4.0.1 . I guess they got some feedback :).

So this is now an INVALID, and the patch doesn't need to be applied.

Note: See TracTickets for help on using tickets.