[Twisted-Python] dropin.cache?

Jean-Paul Calderone exarkun at divmod.com
Tue Jul 10 16:48:48 EDT 2007

On Tue, 10 Jul 2007 16:00:01 -0400, Phil Christensen <phil at bubblehouse.org> wrote:
>So, I've been making great strides with my plugin system, using  twisted's 
>plugin support, but there's just one small issue I'm having  that I can't 
>seem to figure out.
> [snip traceback]
>The issue is that my app doesn't have write access to the various  plugin 
>directories by default, as it runs as a restricted user. This  is basically 
>a configuration detail that my users will have to take  care of, but I'd 
>like to  be able to catch this error and provide a  nicer message, or at 
>least not have my logfile filled up with stack  traces.

It only needs write access to update the cache, and it only needs to update
the cache when a new plugin is installed on the system or an old plugin is
removed.  So, you should be able to completely address this by regenerating
the cache at installation time (you can generate the cache simply by calling
getPlugins and exhausting the iterator it returns).

>The problem is that putting a try/catch around getPlugins doesn't  work, or 
>doesn't appear to. I've looked at the code in getPlugins,  and I can't 
>figure out why the exception isn't being caught. Since  I'm not actually 
>using the reactor, I would assume there's no  deferred trickery that needs 
>to be done, so I'm at a bit of a loss.
>Any help in this matter would be appreciated...

There's an open ticket for changing the reporting of this condition from a
full traceback to a shorter message:


(Hmm, although that's not quite what I remembered, maybe there's another one
as well).


More information about the Twisted-Python mailing list