Prev: PumpMessages et WM_QUIT
Next: ctypes pointer to pointer
From: MaR on 21 Sep 2006 04:23 Thanks guys! :o) It seems that no module is missing since the Service starts and the error message seem to indicate an error in the COM call to the AD. I would expect some other exception.. I do have a separate thread for the asyncore.loop() as I otherwise would risk a lockup. I do not call pythoncom.CoInitialize () as I tend to expect a module wrapping COM stuff to do that. Since I am not really into Windows, I have to ask you, do I make a wrong assumption here? Some further info that may be of interest: python 2.4.3 active_directory 0.4 py2exe 0.6.5 pywin32 208 The Service code is taken from MyService.py supplied with py2exe as a sample. Rgrds//M
From: Tim Golden on 21 Sep 2006 04:50 [MaR] | I do not call pythoncom.CoInitialize () as I tend to expect a module | wrapping COM stuff to do that. Hmmm. A slightly philosophical point. As the author of the said module, I think I'd have said that the other way round: I do not call CoInit... because I expect a user of the module *who needs to involve threading* to do that. However, I'm quite happy to call it willy-nilly as long as there's no overhead. But I'm afraid my knowledge of the interaction of COM with threading is slim and mostly anecdotal. | Some further info that may be of interest: | python 2.4.3 | active_directory 0.4 | py2exe 0.6.5 | pywin32 208 | The Service code is taken from MyService.py supplied with py2exe as a | sample. All that looks good enough. Is it possible for you to include the CoInit... call anyway, simply as a test to see if it is the problem.. It might not be, in which case the point is moot. (At least in this case) If you don't get much help on this list, might be worth moving the discussion over to the python-win32 list. I'm sure many people (like myself) watch both, but there may be some who don't follow this list, but do watch the -- lower traffic -- win32 list. 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 ________________________________________________________________________
From: MaR on 21 Sep 2006 05:38 Tim Golden wrote: > [MaR] > > | I do not call pythoncom.CoInitialize () as I tend to expect a module > | wrapping COM stuff to do that. > > Hmmm. A slightly philosophical point. [snip] :o) I agree! I have added the CoInit.. call to the __init__() of the threaded class (I understood the documentation as that was a proper place.) The exception message changed! Unfortunately I get little wiser.. (yes I confess.. I am spoonfed with unix ;o) The instance's SvcRun() method failed File "win32serviceutil.pyc", line 785, in SvcRun File "MailProxySvc.pyc", line 132, in SvcDoRun File "MailProxySvc.pyc", line 100, in setup File "D:\projects\MailProxy\AddressDB.py", line 54, in loadPersonsFromAD File "active_directory.pyc", line 367, in search File "active_directory.pyc", line 217, in query File "win32com\client\gencache.pyc", line 540, in EnsureDispatch File "win32com\client\CLSIDToClass.pyc", line 50, in GetClass exceptions.KeyError: '{B08400BD-F9D1-4D02-B856-71D5DBA123E9}' //M
From: Tim Golden on 21 Sep 2006 05:52 [MaR] | Tim Golden wrote: | > [MaR] | > | > | I do not call pythoncom.CoInitialize () as I tend to | expect a module | > | wrapping COM stuff to do that. | > | > Hmmm. A slightly philosophical point. | [snip] | | :o) I agree! | | I have added the CoInit.. call to the __init__() of the threaded class | (I understood the documentation as that was a proper place.) | The exception message changed! | Unfortunately I get little wiser.. (yes I confess.. I am spoonfed with | unix ;o) | | The instance's SvcRun() method failed | File "win32serviceutil.pyc", line 785, in SvcRun | File "MailProxySvc.pyc", line 132, in SvcDoRun | File "MailProxySvc.pyc", line 100, in setup | File "D:\projects\MailProxy\AddressDB.py", line 54, in | loadPersonsFromAD | File "active_directory.pyc", line 367, in search | File "active_directory.pyc", line 217, in query | File "win32com\client\gencache.pyc", line 540, in EnsureDispatch | File "win32com\client\CLSIDToClass.pyc", line 50, in GetClass | exceptions.KeyError: '{B08400BD-F9D1-4D02-B856-71D5DBA123E9}' OK. Now we're into the ClassID thing. I'm hoping that someone with py2exe knowhow will chip in here. That line is trying to generate a Python module to correspond to the ADODB.Command typelib: command = EnsureDispatch ("ADODB.Command") The py2exe wiki suggests that a slight nudge to the code might fix the problem: http://www.py2exe.org/index.cgi/IncludingTypelibs At this point there are several options open to us: (in no particular order) 1) You could nudge the code at line 217 to make use of that suggestion. 2) I could do that and send you the result. 3) I could alter the module so it doesn't use gencache at all. I don't seem to be using any constants so the Dispatch might as well be dynamic. 4) None of the above. I'm happy to do (3) and send it to you privately if you're willing to try. Of course, it might not be the cause of the problem in any case! 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 ________________________________________________________________________
From: MaR on 21 Sep 2006 08:22 Tim Golden wrote: [snip..] > At this point there are several options open to us: > > (in no particular order) > 1) You could nudge the code at line 217 to make use of > that suggestion. > 2) I could do that and send you the result. > 3) I could alter the module so it doesn't use gencache > at all. I don't seem to be using any constants so the > Dispatch might as well be dynamic. > 4) None of the above. > > I'm happy to do (3) and send it to you privately if you're > willing to try. Of course, it might not be the cause > of the problem in any case! > > TJG Really appreciate! Reading the page you indicate, I tried solution 3 as it seemed to be the favored one by the author.. I simply added the lines, doing the import and the setting the flag, in a copy of the active_directory module. But maybe you thought of some other nudging? Some kind of progress anyway, I guess (see below). Maybe your offer to do your option (3) is worthwhile after all? //M The instance's SvcRun() method failed File "win32serviceutil.pyc", line 785, in SvcRun File "MailProxySvc.pyc", line 132, in SvcDoRun File "MailProxySvc.pyc", line 100, in setup File "AddressDB.pyc", line 55, in loadPersonsFromAD File "active_directory_M.pyc", line 369, in search File "active_directory_M.pyc", line 219, in query File "win32com\client\gencache.pyc", line 536, in EnsureDispatch File "win32com\client\gencache.pyc", line 520, in EnsureModule File "win32com\client\gencache.pyc", line 287, in MakeModuleForTypelib File "win32com\client\makepy.pyc", line 223, in GenerateFromTypeLibSpec File "win32com\client\gencache.pyc", line 141, in GetGeneratePath exceptions.IOError: [Errno 2] No such file or directory: 'D:\\projects\\MailProxy\\dist\\library.zip\\win32com\\gen_py\\__init__.py'
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: PumpMessages et WM_QUIT Next: ctypes pointer to pointer |