468,305 Members | 1,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,305 developers. It's quick & easy.

IOError in windows service

Hi all

I have a script (attached) that creates a windows service. Basically the
service periodically runs a program 'program.exe'. This all works fine,
but during testing I discovered that if I include any 'print' statements
(used to debug the service when its run in 'debug' mode), when _not_ in
debug mode, it throws an error:

The instance's SvcRun() method failed
File "C:\Python25\Lib\site-packages\win32\lib\win32serviceutil.py",
line 785, in SvcRun
File "C:\Program Files\Program\MyService.py", line 28, in SvcDoRun
print "Entering while loop..."
<type 'exceptions.IOError'>: (9, 'Bad file descriptor')

I have removed the 'print' statements, after which the service runs
fine, but was just curious to find out the reason for this error.




The three things to remember about Llamas:
1) They are harmless
2) They are deadly
3) They are made of lava, and thus nice to cuddle.

Jun 27 '08 #1
0 604

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.