Py2Exe and the log file...

Thomas Heller theller at python.net
Tue Jul 5 10:43:34 EDT 2005


"fowlertrainer at anonym.hu" <fowlertrainer at anonym.hu> writes:

> Hi !
>
> 1. Thanx for your answer in the theme of Unicode, and other things.
> 2. The problem:
> I need to create an application that not need Python libs to install.
> Py2Exe is good for that, but I need to copy the "dist" to the network
> drive what mapped readonly.
> This is a protection.
>
> So: in this time I have been use same applications, but they are
> created by Delphi.
> These apps make logs into user's temp to avoid the log merging, and
> log creation problems (in readonly drive).
>
> Py2Exe have an exception catcher "module", that log the errors in the
> log file that created in app dir.
> This is problem, because the log file creation have been failed in RO drive.
>
> How to I redirect this log file, or can I do anything to aviod the log
> file creation error ?
>
> Thanx for your help: ft

The code that creates the logfile is in "Lib/site-packages/py2exe/boot_common.py".
This code is executed before the main script is started.

You can override it by assigning another object to sys.stderr, at the
start of your main script, which has a write method doing what YOU want.

Thomas



More information about the Python-list mailing list