Using py2exe to wrap a service?

Tim Golden tim.golden at viacom-outdoor.co.uk
Wed Sep 20 10:06:44 EDT 2006


[Maria.Reinhammar at accalon.com]

[... snip ...]

|   File "win32com\client\__init__.pyc", line 73, in GetObject
|   File "win32com\client\__init__.pyc", line 88, in Moniker
| pywintypes.com_error: (-2147221020, 'Invalid syntax', None, None)
| 
| The offending line is:
| import active_directory as AD
| ...
| for item in AD.search ("objectCategory='Person'"):

Not infrequently -- and quite bizarrely -- "Invalid syntax"
errors in COM sometimes come down to a mishandling of threading. 
To ask the obvious: do you have a pythoncom.CoInitialize ()
somewhere in your code?

This is a bit invisible, because Services are inherently
threaded, while you were probably running it before
unthreaded.

May not be the answer, but worth a try.

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list