From: le d. <le....@la...> - 2008-03-25 14:23:08
|
Sorry, it was a mistake from me. I tried to get a traceback for debugging in the except statement and so I used traceback.print_exc which is not what I should have done. Since I've corrected it with traceback.format_exc and everything is now ok. Mark Hammond wrote : > The .log file is written whenever something is written to sys.stderr - what > is in that file? Can you modify one of the samples that reproduces the > error? Did you test the .py and the .exe versions on the same machine with > the same args? I can't see why it would fail under py2exe, but the output > would offer a clue. Search the archives of this list for more details about > how and when the .log file is created... > > Cheers, > > Mark > >> -----Original Message----- >> From: py2...@li... [mailto:py2exe-users- >> bo...@li...] On Behalf Of le dahut >> Sent: Tuesday, 25 March 2008 9:12 PM >> To: py2...@li... >> Subject: Re: [Py2exe-users] Py2exe and try/except >> >> Does someone have any information about try/except and py2exe ? I >> really >> despair to find a solution. >> >> Thanks in advance. >> >> le dahut wrote : >>> Reading myself, I found me incomplete. >>> >>> The try/except statement is correctly interpreted when the program is >>> run under it's .py version. >>> >>> The half try/except/traceback phenomenon appears only on py2exed >>> programs. For me it has only appeared with win32 apis. If the >> exception >>> is about the unexisting file('c:\\myfile.wri','r').read(), try/except >> is >>> correctly interpreted in .py and in .exe mode. >>> >>> >>> le dahut wrote : >>>> 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 ? >>>> >>>> Thanks in advance. >>>> >> ----------------------------------------------------------------------- >> -- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Py2exe-users mailing list >> Py2...@li... >> https://lists.sourceforge.net/lists/listinfo/py2exe-users > > > |