Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Py2exe - Bad File Descriptor

7 views
Skip to first unread message

T

unread,
Feb 28, 2010, 1:35:23 PM2/28/10
to
I have a Python script, which is a Windows Service, that I created an
EXE of via py2exe. As part of the program, it calls some external
binaries, one of which restarts the computer. When I'm logged in,
this works fine. However, if I log out, the service stops and logs
the following error in the Event Log:

<type 'exceptions.IOError'>:(9, 'Bad file descriptor')

Anyone have an idea what could be causing this?

Message has been deleted

T

unread,
Feb 28, 2010, 4:22:19 PM2/28/10
to
On Feb 28, 3:48 pm, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote:
> On Sun, 28 Feb 2010 10:35:23 -0800 (PST), T <misceveryth...@gmail.com>
> declaimed the following in gmane.comp.python.general:
>         Without code, one must play psychic... And I haven't dusted off the
> Tarot cards, I Ching coins, and Crystal balls is some time (No, I don't
> have a ouija board)...
>
>         Could it be you have a mapped drive that gets disconnected when you
> log off?
>
>         Is the service being started as part of your login?
>
>         Does it attempt to write to a console?
> --
>         Wulfraed         Dennis Lee Bieber               KD6MOG
>         wlfr...@ix.netcom.com      HTTP://wlfraed.home.netcom.com/

Sorry for the lack of code - yes, it does try to write to the
console. From what I'm finding, this error may be due to the fact
that there is no "console" to write to when I'm logged off. However,
I would like to be able to print to screen if I run the EXE in debug
mode (i.e. "myservice.exe debug"). Do you know of any way around
this? Also, I need to get the output generated from an external EXE -
will subprocess.Popen cause problems if I use stdout=PIPE? Thanks for
your help!

Message has been deleted

T

unread,
Mar 1, 2010, 7:41:57 PM3/1/10
to
On Feb 28, 10:00 pm, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote:
> On Sun, 28 Feb 2010 13:22:19 -0800 (PST), T <misceveryth...@gmail.com>

> declaimed the following in gmane.comp.python.general:
>
> > Sorry for the lack of code - yes, it does try to write to the
> > console.  From what I'm finding, this error may be due to the fact
> > that there is no "console" to write to when I'm logged off.  However,
> > I would like to be able to print to screen if I run the EXE in debug
> > mode (i.e. "myservice.exe debug").  Do you know of any way around
> > this?  Also, I need to get the output generated from an external EXE -
> > will subprocess.Popen cause problems if I use stdout=PIPE?  Thanks for
> > your help!
>
>         True services typically don't have interactive (console) type I/O...
> What is more likely to work is to have an open socket waiting for
> connections, and the use of a separate user-space client that connects
> to the socket...

> --
>         Wulfraed         Dennis Lee Bieber               KD6MOG
>         wlfr...@ix.netcom.com      HTTP://wlfraed.home.netcom.com/

So how would that work..would the program buffer all the "print"
output, then send it to the client when it connects? Do you happen to
know of any available code that utilizes this method, or something
similar? Thanks for your help.

Message has been deleted
0 new messages