[python-win32] Error 1789 during logon, except not really called

Tim Golden mail at timgolden.me.uk
Fri Mar 14 16:53:07 CET 2008

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.

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?


More information about the python-win32 mailing list