[Twisted-Python] run python application with twistd -y ifinger.tac, error occurs. please help to check

Laurens Van Houtven _ at lvh.io
Tue Sep 17 10:10:23 MDT 2013


On Tue, Sep 17, 2013 at 2:14 PM, <exarkun at twistedmatrix.com> wrote:

> I think there are still many unported dependencies of `twistd` to port
> first.
>

Sure, but every little bit helps, right? :)


>  Can someone comment as to why this was put there in the first place, and,
>> specifically, why it can't just be "pass"? Is there some logging system
>> that looks at the current exception or something when twistd (or some
>> other
>> script) starts?
>>
>
> Both `log.err()´ and `Failure()´ look at the current exception.  If we
> don't `sys.clear_exc()´ here then the first piece of code that tries to use
> either of those may get a surprising result.  The current exception state
> can last a long time so this surprise can hide for a remarkably long time
> before showing up.
>

Okay, cool. From what I understand:

1. _preamble is just a hack to get bin/whatever to work right without
installing (i.e. from a checkout)
2. (not too sure about this) in py3k, except statements do the clearing bit
already: www.python.org/dev/peps/pep-3110/#semantic-changes

So, does that mean we can do a try: ... ; except AttributeError and be done
with it?

The exception state also holds references to lots of extra things on the
> stack which is undesirable even if there are no other side-effects.
>
> Jean-Paul
>

lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20130917/4a28bb9f/attachment-0002.html>


More information about the Twisted-Python mailing list