[python-win32] Error 1789 during logon, except not really called
le dahut
le.dahut at laposte.net
Fri Mar 14 17:21:37 CET 2008
Tim Golden wrote :
> le dahut wrote:
>> What strange is is that:
>>
>> try:
>> wsec.LookupAccountName(...)
>> except:
>> print 'Error'
>>
>> shows :
>> - a traceback, as if I didn't put LookupAccountName in a try/except
>> statement
>> - the string 'error' so the program has also switched to except as if
>> the try/except has been correctly interpreted
>>
>> So we can say that I get the two behaviours in one. At the exception
>> that the traceback is not complete, it only talks about the line
>> containing LookupAccountName, not entire traceback (the caller function
>> and its parents).
>
> Well that is an extremely clear description of the problem. And,
> unsurprisingly, I can't get it to fail at the interpreter or
> (just in case) from within a file.
>
> <guesswork>
> Is there any possibility that there's an atexit handler or a thread
> going on which is generating the other traceback? Or even a stray
> __del__ or something equally bizarre? Or maybe the code's dropping
> through after handling the exception to some other code which is
> printing the traceback?
> </guesswork>
>
Actually, the code doesn't break, it continues its execution as if
try/except as done its work.
It is run in a twisted reactor.
"a stray _del_" could you be more precise ?
More information about the python-win32
mailing list