IOError in windows service

Discussion in 'Python' started by Aspersieman, May 26, 2008.

  1. Aspersieman

    Aspersieman Guest

    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:

    <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.

    Regards

    Nicol

    --

    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.
     
    Aspersieman, May 26, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Cobban

    Xerces parse aborted on IOError

    Jim Cobban, Dec 5, 2003, in forum: XML
    Replies:
    0
    Views:
    403
    Jim Cobban
    Dec 5, 2003
  2. Bart Nessux

    urllib IOError Exception

    Bart Nessux, Jun 11, 2004, in forum: Python
    Replies:
    4
    Views:
    1,567
    John J. Lee
    Jun 14, 2004
  3. Jay Donnell

    IOError: [Errno 32] Broken pipe

    Jay Donnell, Jun 28, 2004, in forum: Python
    Replies:
    2
    Views:
    8,419
    Donn Cave
    Jun 29, 2004
  4. Dave Angel
    Replies:
    0
    Views:
    584
    Dave Angel
    Aug 24, 2009
  5. Tim Golden
    Replies:
    6
    Views:
    2,799
    ryniek
    Aug 25, 2009
Loading...

Share This Page