我正在尝试使用pywin32读出windows事件日志
machineAdress = None
eventType = "Application"
log_handle = win32evtlog.OpenEventLog(machineAdress, eventType)
flags = win32evtlog.EVENTLOG_BACKWARDS_READ | win32evtlog.EVENTLOG_SEQUENTIAL_READ
events = win32evtlog.ReadEventLog(log_handle, flags, 0)不幸的是,win32evtlog.ReadEventLog失败,并显示以下错误:
OverflowError: days=1757830483; must have magnitude <= 999999999
The above exception was the direct cause of the following exception:
SystemError: <built-in function ReadEventLog> returned a result with an error set根据doc的说法
machineAdress是Windows主机(例如"localhost"),eventType是Windows事件日志源的名称(例如"System"、"Application"等)。错误在所有情况下都是相同的,只是days=...的数量发生了变化。
我在Windows (64位)上使用Python 3.7。提前感谢!
https://stackoverflow.com/questions/51172283
复制相似问题