[reportlab-users] Re: [Installer] Re: "Bad file descriptor" after py2exe or Installer

Thomas Heller reportlab-users@reportlab.com
Fri, 12 Dec 2003 16:31:52 +0100


"Mark Hammond" <mhammond@skippinet.com.au> writes:

>> It seems I cannot reproduce this with py2exe 0.5.
>> Can you?
>
> My experience (with Python itself, not py2exe) is that it depends on the
> environment.  If stdout is an invalid file descriptor, Python will raise an
> exception.  This is *very* common when running inside IIS (via win32com),
> and occasionally services.  I've never really found the pattern, but did
> find in all cases, stdout/err was indeed invalid.
>
> I *think* that Python has recently made this more brittle - possibly by
> checking the result of the IO operations more often.  There is an open
> Python bug at sourceforge.

I have also seen this, especially in non-console frozen programs.
It isn't really obvious, because tracebacks aren't visible.

py2exe 0.5, for non-console exes, automatically redirects sys.stderr
into a logfile, the name derived from the exe-name, and sys.stdout into
a file-like objects which will simply ignore the string.

Of course, this has nothing to do anymore with the OP's problem.

Thomas