I am trying to read out the windows event log using pywin32:
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)
Unfortunately, win32evtlog.ReadEventLog fails with the following error:
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
According to the doc:
machineAdress is a Windows host (e.g. "localhost") and eventType is the name of the source of the Windows event logs (e.g. "System", "Application", ...). The error is the same in all cases, only the number of days=... changes.
I'm using Python 3.7 on Windows (64 bit). Thanks in advance!
machineAdressandeventType(post your full code)? Can you post the full traceback (and the line that generates the error - although it seems it's the last posted one)? Please check [SO]: How to create a Minimal, Complete, and Verifiable example (mcve). Also did you check - CristiFati