Ich habe ein Audit-Skript, das nachts während eines bestimmten Zeitraums eine Reihe von Operationen durchführt.
Ein Teil dieses Skripts verwaltet Windows-Updates.
Wir haben soeben das Update (Version 2.6.1.17384) durchgeführt und mein Skript funktioniert nicht mehr.
Das Ziel ist es, dasselbe zu erreichen wie mit "wapt-get waptwua-install", jedoch ohne geplante Aufgabe.
Hier ist der Codeabschnitt, der mir Probleme bereitet:
Code: Alle auswählen
# -*- coding: utf-8 -*-
from setuphelpers import *
from waptwua.client import WaptWUA
def audit():
with EnsureWUAUServRunning():
wua_client = WaptWUA(WAPT)
wua_client.install_updates()
Code: Alle auswählen
2026-07-03 10:53:13,522 ERROR ERROR installing update: 0x800401f0 : CoInitialize n’a pas été appelé.
2026-07-03 10:53:13,768 CRITICAL Unable to build status data for key host_networking: x_wmi_uninitialised_thread("WMI returned a syntax error: you're probably running inside a thread without first calling pythoncom.CoInitialize[Ex]")
2026-07-03 10:53:13,773 CRITICAL WMI is broken on this computer. See https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-rebuilding-the-wmi-repository/ba-p/373846 : x_wmi_uninitialised_thread: <x_wmi: WMI returned a syntax error: you're probably running inside a thread without first calling pythoncom.CoInitialize[Ex] (no underlying exception)>
[]
re-enabling wuauserv previous state: 0
2026-07-03 10:53:14,246 CRITICAL Fatal error in audit function: x_wmi_uninitialised_thread: <x_wmi: WMI returned a syntax error: you're probably running inside a thread without first calling pythoncom.CoInitialize[Ex] (no underlying exception)>:
