Py2exe and logging module

sfbell09 sfbell09 at
Sun Nov 2 15:04:29 CET 2003

I found the solution to the problem using Joe's advice. I built the
application using the --console option. This let me see that the smtp
logger was failing because of an encoding issue with IDNA. So, using
the py2exe flag --packages encodings and also encoding the server name
as a string solved the problem.

--- In python-list at, Joe Francia <usenet at s...> wrote:
> sfbell09 wrote:
> > Hi,
> > 
> > My question is about the logging module and py2exe. When my code is in
> > natural python, all of the logging works perfectly. I have two logging
> > functions, one is a File Handler, the other is a SMTP handler. Once I
> > build the code using py2exe, the File Handler still works, but the
> > SMTP does not send any messages. 
> > 
> > 1. Any thoughts on why this might be happening.
> > 2. Is there any way for the executable to return debugging
> > information? It's a wxPython gui app.
> > 
> > Thanks.
> > 
> A quick & dirty way is to build with py2exe's --console option, and 
> traceback will print in the DOS window (which will close if your app 
> quits - so handle those exceptions).
> Other suggestions:  run in a debugger, or log activities to a file
or to 
> a separate wxPython frame|statusbar|text control.
> Peace,
> Joe
> -- 

More information about the Python-list mailing list