[Twisted-Python] Deprecation consternation

Glyph Lefkowitz glyph at twistedmatrix.com
Fri Aug 16 22:05:35 EDT 2002

On Fri, 16 Aug 2002 14:45:34 -0400, Steve Waterbury <waterbug at beeblebrox.gsfc.nasa.gov> wrote:
> I understand that the way the authorizer machinery is assembled into 
> twisted seems to be morphing (and not completely propagated into other 
> twisted components yet, hence all the deprecation messages when 
> running the unit tests), and I was trying to see if I could do things 
> properly (the new way) in my code -- but not successfully yet, I guess, 
> because when running this (shamelessly purloined and modified from the 
> pgquoter.py example):

Morph*ed*, thankfully -- I don't forsee any future changes at this point,
besides eventually cleaning up these internal deprecation warnings and
eventually removing the backwards compatibility code.  Unless I made a mistake,
of course, which is impossible.

> I understand the second 2 warnings, which are internal to twisted, but 
> I'm puzzled by the first one, which refers to this line:

>         pb.Service.__init__(self, serviceName, authorizer, application)

> I thought I _was_ passing an authorizer separately!

Heh.  Perhaps the warning should be a bit clearer:

    def __init__(self, serviceName, serviceParent=None, authorizer=None, application=None):

> Suggestions?  What should the syntax be under the new authorizer regime?

You're just passing the authorizer and application in the reverse order :-).
Other than that you're OK with the "new regime".  You should also see one of
the other warnings go away.

It looks like your "application" is None in this example, though, just at a
glance through the twisted.cred.service code that's spitting out this warning.

 |    <`'>    |  Glyph Lefkowitz: Traveling Sorcerer   |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020816/28787fea/attachment.pgp 

More information about the Twisted-Python mailing list