Problem: Lasse ich die Funktion test() durchlaufen, klappt alles (nach einem Timeout von 10 Sekunden wird diese beendet). Nun habe ich das ganze aufgebohrt und möchte nicht nur neue Prozesse erkennen. Ich bekomme folgende seltsame Fehlermeldung (für jeden der 4 Threads ein Fehler) und die CPU-Auslastung steigt auf 100%.
Findet jemand nen Fehler? Liegt's vielleicht am Threading?
Manchmal kommt aber auch die Fehlermeldung hier:Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Programme\Python24\lib\threading.py", line 442, in __bootstrap
self.run()
File "C:\Programme\Python24\lib\threading.py", line 422, in run
self.__target(*self.__args, **self.__kwargs)
File "procmon.py", line 53, in __run_watcher
process = watcher()
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 1015, in __call__
handle_com_error (error_info)
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 187, in handle_com
_error
exception_string.append (" %s - %s" % (hex (scode), error_description.strip
()))
AttributeError: 'NoneType' object has no attribute 'strip'
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Programme\Python24\lib\threading.py", line 442, in __bootstrap
self.run()
File "C:\Programme\Python24\lib\threading.py", line 422, in run
self.__target(*self.__args, **self.__kwargs)
File "procmon.py", line 53, in __run_watcher
process = watcher()
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 1015, in __call__
handle_com_error (error_info)
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 187, in handle_com
_error
exception_string.append (" %s - %s" % (hex (scode), error_description.strip
()))
AttributeError: 'NoneType' object has no attribute 'strip'
Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\Programme\Python24\lib\threading.py", line 442, in __bootstrap
self.run()
File "C:\Programme\Python24\lib\threading.py", line 422, in run
self.__target(*self.__args, **self.__kwargs)
File "procmon.py", line 53, in __run_watcher
process = watcher()
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 1015, in __call__
handle_com_error (error_info)
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 187, in handle_com
_error
exception_string.append (" %s - %s" % (hex (scode), error_description.strip
()))
AttributeError: 'NoneType' object has no attribute 'strip'
Exception in thread Thread-3:
Traceback (most recent call last):
File "C:\Programme\Python24\lib\threading.py", line 442, in __bootstrap
self.run()
File "C:\Programme\Python24\lib\threading.py", line 422, in run
self.__target(*self.__args, **self.__kwargs)
File "procmon.py", line 53, in __run_watcher
process = watcher()
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 1015, in __call__
handle_com_error (error_info)
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 187, in handle_com
_error
exception_string.append (" %s - %s" % (hex (scode), error_description.strip
()))
AttributeError: 'NoneType' object has no attribute 'strip'
Hier der Code:Traceback (most recent call last):
File "procmon.py", line 10, in ?
class Win32ProcessMonitor:
File "procmon.py", line 11, in Win32ProcessMonitor
__wmi = wmi.WMI()
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 1124, in connect
handle_com_error (error_info)
File "C:\Programme\Python24\Lib\site-packages\wmi.py", line 188, in handle_com
_error
raise x_wmi, "\n".join (exception_string)
wmi.x_wmi: -0x7ffdfff7 - Ausnahmefehler aufgetreten.
Error in: SWbemServicesEx
-0x7ffbef94 - Datentrõgerkontingentverletzung
Code von Gerold ausgelagert: http://paste.pocoo.org/show/26860/
Tags: Win32 WMI Prozess Monitor Process Monitor
Edit by Gerold: Code ausgelagert