473,511 Members | 14,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: IOError in windows service

En Mon, 26 May 2008 06:41:26 -0300, Aspersieman <as*********@gmail.comescribió:
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:

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

I have removed the 'print' statements, after which the service runs
fine, but was just curious to find out the reason for this error.
Usually services don't have a console attached so sys.stdout is invalid. Just don't print anything...

--
Gabriel Genellina

Jun 27 '08 #1
0 715

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2265
by: Bob Swerdlow | last post by:
We have some users of our application getting error messages like: IOError: zipimport: can not open file /Volumes/MyApp/MyApp.app/Contents/Resources/Modules.zip This only happens on our Mac...
5
7657
by: jkn | last post by:
Hi all Python 2.4.2 (#1, Apr 26 2006, 23:35:31) on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "<stdin>", line 1, in...
0
1564
by: Robert Dollinger | last post by:
Hi to everyone, I have a Service, that runs on a WinXP machine. The service read a file on a Win98 machine and write the content in a file on the WinXP machine. After tree times I get the error...
0
711
by: Aspersieman | last post by:
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...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.