Problem listing services with wmi
Jean-Sébastien Guay
jean_seb at videotron.ca
Wed May 18 10:38:26 EDT 2005
Hi again Tim,
>OK. I'm running 2.3 normally but I've run the scripts with
>2.4 so I don't think it makes a difference. I'll leave the
>set import logic in place so I don't have to remember.
>
>
Any reason I should know about that you haven't updated to 2.4? I just
got into Python, so I got the latest version, but if there's something
wrong with 2.4 I'd like to know...
>It would be interesting
>to know what it is about one or more services which gives WMI a
>problem
>
>
Which is what really puzzles me... From the list of 21 services that
were gotten by win32service and not wmi, I can't see any service that's
"special" in any way... So without further investigation, I really
couldn't say.
>I think that all we're likely to achieve is, as I say, a more
>robust solution; we're unlikely to get the missing service
>if the core WMI can't see it for some reason.
>
But if we can get WMI to just "skip over" the offending service, at
least then we'll be able to know which one causes this...
>n_services = services.Count
>
It now fails at the line above, with the following error :
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "G:\Python-2.4\Lib\site-packages\win32com\client\__init__.py",
line 455, in __getattr__
return self._ApplyTypes_(*args)
File "G:\Python-2.4\Lib\site-packages\win32com\client\__init__.py",
line 446, in _ApplyTypes_
return self._get_good_object_(
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
'SWbemObjectSet', 'Critical error ', None, 0, -2147217398), None)
I had tried something similar yesterday, with the same results. It would
seem (from what I can understand) that c.ExecQuery() just makes a list
of proxy objects, and that when you call Count on the set, it has to
create them all for real and that's where it fails when reaching the
"bad" service.
Thanks again, looking forward to trying other ideas.
J-S
--
___________________________________________
Jean-Sébastien Guay jean_seb at videotron.ca
http://whitestar02.webhop.org/
More information about the Python-list
mailing list