[Twisted-Python] Failed to load application: cannot import name app

Jean-Paul Calderone exarkun at divmod.com
Tue Jul 7 11:37:19 EDT 2009


On Tue, 7 Jul 2009 17:20:41 +0200, Jesper Taxbøl <jesper at taxboel.dk> wrote:
>Hi Guys,
>
>I stumpled upon a small dns filter program, that I am having trouble
>running, due to "twisted.internet.app" being deprecated. I get the following
>output "Failed to load application: cannot import name app"
>
>Im running "twistd (the Twisted daemon) 2.5.0"
>
>Any advice on how to proceed?
>
>Kind regards
>
>Tax
>
> [snip]
>application = app.Application('Non caching anti-verisign domain name
>resolver')
>application.listenUDP(53, p)
>application.listenTCP(53, f)
>

I think the `listenUDP´ line probably causes an AttributeError to be raised.
This prevents the tac file from being evaluated completely, so twistd ends
up with an exception instead of an application.  Take a look at the classes
in twisted.application.internet (eg UDPServer, TCPServer) for the way to set
up servers the new way.

Jean-Paul



More information about the Twisted-Python mailing list