[Twisted-Python] run python application with twistd -y ifinger.tac, error occurs. please help to check
exarkun at twistedmatrix.com
exarkun at twistedmatrix.com
Tue Sep 17 06:14:08 MDT 2013
On 09:06 am, _ at lvh.io wrote:
>Hi Charles,
>
>
>Yes, twistd doesn't appear to work on py3k. Not being able to import
>_preamble is normal (once Twisted has been installed), but _preamble
>does
>assume sys.exc_clear exists, which isn't true on 3.x.
>
>I couldn't find any ticket on this. Perhaps you should file it (and
>maybe
>fix it!) :)
I think there are still many unported dependencies of `twistd` to port
first.
>It's my understanding that the new except clause semantics are expected
>to
>take care of this problem.
>
>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.
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
More information about the Twisted-Python
mailing list