python1.5.2 + nt services + COM

Steven Scott Steven.Scott at Synchrologic.com
Fri Nov 9 12:44:00 EST 2001


Hi, I'm having a pretty infuriating problem here....keep in mind I don't
know a whole lot about python and even less about com and whatnot.  and if
my text is wrapped incorrectly, sorry, I can't find the option to set line
length in outlook.

to my question...I'm running a script as an NT service, using xmlrpclib.
I've got one method that crashes when run as a service (but not in an
interactive python session).  by removing all the content of the method and
adding code back in line by line, I see that it's crashing on a
win32com.client.Dispatch() call.  here's what I get when I redirect stderr
into a file:

---------------------------------------------------------------
Traceback (innermost last):
  File "C:\Harness\machineInfoService.py", line 179, in getDriverVersion
    regUtility = win32com.client.Dispatch('SynchroQA.UTLRegistry')
  File "C:\Program Files\Python\win32com\client\__init__.py", line 94, in
Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Program Files\Python\win32com\client\dynamic.py", line 80, in
_GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Program Files\Python\win32com\client\dynamic.py", line 71, in
_GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2147467259, 'Unspecified error', None, None)

---------------------------------------------------------------

I'm not specifically using threads, although I am subclassing
win32serviceutil.ServiceFramework as per the ntservice example that comes
with win32all...I don't know if it does something with threads, but I'm led
to believe that it's so.

although I'd like to, upgrading to python2 isn't an option right now.

the weirdest thing about this is that it works on a 2000 server machine and
an XP pro machine, but none of the other machines I've tried (2000 server,
adv server, NT4) will work.

can anybody give me some insight into what's wrong?

thanks




More information about the Python-list mailing list