[python-win32] Py2exe and try/except

le dahut le.dahut at laposte.net
Tue Mar 18 18:12:02 CET 2008


Hello,
I've noticed that when using win32 api in a try/except statement, if the 
error doesn't appear on the line just after try, I get a 
<my_progname>.exe.log file.

Example :

* This genreates <my_app>.exe.log :
try:
     logging.info('mounting printer')
     w32print.AddPrinterConnection(printer)
except Exception, e:
     logging.error('Error mounting printer')

* This does not :
logging.info('mounting printer')
try:
     w32print.AddPrinterConnection(printer)
except Exception, e:
     logging.error('Error mounting printer')


Any idea ?



More information about the python-win32 mailing list