Message: 3 Date: Thu, 16 Jul 2009 16:08:51 -0700 From: Tim Roberts <t...@probo.com> To: python-win32@python.org Subject: Re: [python-win32] Python parser for Windows Event Logs Message-ID: <4a5fb303.7010...@probo.com> Content-Type: text/plain; charset=ISO-8859-1
Tony Cappellini wrote: > I've added the While loop Mark suggested but still see the same issue. > GetNumberOfEventLogRecords() still returns 6 events, > However the object returned from ReadEvenLog() still only contains 3 objects > The next call to ReadeventLog() returns None > >OK, in my test, repeated calls to ReadEventLog eventually fetch all of >the events. Each call to ReadEventLog will return however many events >will fit in 1024 bytes, which is the buffer in the pywin32 code. If I >change your code to this: >while 1: > events=win32evtlog.ReadEventLog(hand,flags,0) > if not events: > break > for event in events: > print event.EventID, event.StringInserts >then it all works as expected. This is what I'm doing. I have added the while 1 last week, after Mark had suggested it. It did not change anything. ReadEventLog() returns None on successive calls. Which versions of Python and Pywin32 are you using? _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32