Using py2exe to wrap a service?
Thomas Heller
theller at python.net
Wed Sep 20 10:11:36 EDT 2006
Tim Golden schrieb:
> [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.
Maybe another possibility is that py2exe fails to include makepy
generated modules. Could that lead to this error?
Thomas
More information about the Python-list
mailing list