'Interrupted function call' in time.sleep(1000) after relogging

Sylwia lubowiecka at go2.pl
Wed Jan 7 13:17:54 CET 2004


I have implemented a Python services. It behaves as a supervisor for
log files.
If the space used by log files is bigger than a given upper limit,
then it starts to delete log files until the space is less than a
given lower limit. It checks the space every 1000 secs. After that it
falls asleep. It is configured to start up automatically on system
boot. Everything works ok except one thing ... :( The service should
run even when I log off, so I made an experiment. It turned out that
after relogging (I have to press Ctrl+Ald+Del) the following exception
was raised:

The instance's SvcRun() method failed 
  File "C:\Python23\lib\site-packages\win32\lib\win32serviceutil.py",
line 663, in SvcRun
  File "C:\SEE\modules\adminapps\purgeLogFilesService.py", line 158,
in SvcDoRun
exceptions.IOError: (4, 'Interrupted function call')

Here is the part of my code (inside SvcDoRun) that generates the

            #check if the service is going to be stopped
            waitHandles = self.hWaitStop, 
            stp = win32event.WaitForMultipleObjects(waitHandles, 0,
            if stp == win32event.WAIT_OBJECT_0:
                #print "Received Quit from Win32"
                time.sleep(1000) # <--- Exception generated here!!!

How can I solve it? Maybe I should try to patch a new timemodule.c
file? I have no idea :( I would be greatful for any hints.
I use Windows XP operating system.

Best wishes,


More information about the Python-list mailing list