pyInstaller and logging

210 views
Skip to first unread message

Hannes MŸueller

unread,
Feb 23, 2007, 3:55:08 AM2/23/07
to pyins...@googlegroups.com
Hi.

I seem to have another stange problem, and I was wondering if any of you
encountered this before.

We use logging extensively in our application, but when I pack the
program with pyInstaller, I get some IOErrors:

Trace:
File ".....\out1.pyz/logging", line xxx, in emit
File ".....\out1.pyz/logging", line xxx, in flush
IOError: [Errno 9] Bad file descriptor

everytime I try to log something.

As mentioned before, I use wxPython 2.8.1.1, Python 2.5 and pyInstaller 1.3

The strange thing is, when I use a smaller version of our program (some
extra classes are not initialized, fewer windows, like a demo mode) the
logging works.

So I was hoping for some hints before I try to crawl through the program
and construct test cases. Anyone encountered this before? Could it be
connected to multiple logger instanciations?

Hannes

Hannes MŸueller

unread,
Mar 6, 2007, 4:50:33 AM3/6/07
to pyins...@googlegroups.com

Can anyone think of a possible cause? That would really help me in
pinpointing the problem and creating a test case...

Hannes

Giovanni Bajo

unread,
Mar 12, 2007, 7:48:34 PM3/12/07
to PyIns...@googlegroups.com

Does this happen if you package the program in console mode? Does this happen
if you run your application (unpackaged) with "pythonw"?
--
Giovanni Bajo

Hannes Müller

unread,
Mar 13, 2007, 2:39:48 AM3/13/07
to PyIns...@googlegroups.com

I will test it today, but I found a "workaround" of sorts by just
redirecting the log to a file, then it works.
Will follow up to your questions later today.

Thanks,
Hannes

Hannes MŸueller

unread,
Mar 13, 2007, 5:41:26 AM3/13/07
to pyins...@googlegroups.com

It happens when I run the unpackaged application with "pythonw". It does
not happen when I run it with "python".

Hannes

Giovanni Bajo

unread,
Mar 13, 2007, 1:09:52 PM3/13/07
to PyIns...@googlegroups.com
On 3/13/2007 10:41 AM, Hannes MŸueller wrote:

>> I will test it today, but I found a "workaround" of sorts by just
>> redirecting the log to a file, then it works.
>> Will follow up to your questions later today.
>>
>> Thanks,
>> Hannes
>
> It happens when I run the unpackaged application with "pythonw". It does
> not happen when I run it with "python".

Thus, I would say that you should bring this to the logging guys. It
might not even be a bug, only an (undocumented? unclear?) quirk. But I
think it is not related to PyInstaller.
--
Giovanni Bajo


Don Dwiggins

unread,
Mar 13, 2007, 2:07:09 PM3/13/07
to pyins...@googlegroups.com
Hannes MŸueller wrote:
> It happens when I run the unpackaged application with "pythonw". It does
> not happen when I run it with "python".

Here's a thought: if you're logging to stdout or stderr, those file
objects may not be instantiated by pythonw. I seem to remember this
being reported on the wxPython list (try searching that list for "stdout
or stderr").

HTH,

--
Don Dwiggins
Advanced Publishing Technology

Hannes Müller

unread,
Mar 14, 2007, 3:48:16 AM3/14/07
to PyIns...@googlegroups.com
On 3/13/07, Don Dwiggins <ddwi...@advpubtech.com> wrote:
>
> Hannes MŸueller wrote:
> > It happens when I run the unpackaged application with "pythonw". It does
> > not happen when I run it with "python".
>
> Here's a thought: if you're logging to stdout or stderr, those file
> objects may not be instantiated by pythonw. I seem to remember this
> being reported on the wxPython list (try searching that list for "stdout
> or stderr").
>
> HTH,

Ah yes, now I remember...
Thanks for all the advice!

Hannes

Reply all
Reply to author
Forward
0 new messages