From: <mha...@us...> - 2003-06-07 02:20:05
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv15767 Modified Files: win32evtlogutil.py Log Message: SafeFormatMessage always returns Unicode (so encoding exceptions happen in the caller!:) Index: win32evtlogutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32evtlogutil.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32evtlogutil.py 9 May 2002 05:55:48 -0000 1.6 --- win32evtlogutil.py 7 Jun 2003 02:06:16 -0000 1.7 *************** *** 120,124 **** finally: win32api.RegCloseKey(handle) ! return data or '' # Don't want "None" ever being returned. def SafeFormatMessage( eventLogRecord, logType=None ): --- 120,124 ---- finally: win32api.RegCloseKey(handle) ! return data or u'' # Don't want "None" ever being returned. def SafeFormatMessage( eventLogRecord, logType=None ): *************** *** 133,138 **** desc = "" else: ! desc = string.join(map(lambda x:str(x), eventLogRecord.StringInserts), ", ") ! return "<The description for Event ID ( %d ) in Source ( %s ) could not be found. It contains the following insertion string(s):%s.>" % (winerror.HRESULT_CODE(eventLogRecord.EventID), eventLogRecord.SourceName, desc) def FeedEventLogRecords(feeder, machineName = None, logName = "Application", readFlags = None): --- 133,138 ---- desc = "" else: ! desc = u", ".join(eventLogRecord.StringInserts) ! return u"<The description for Event ID ( %d ) in Source ( %r ) could not be found. It contains the following insertion string(s):%r.>" % (winerror.HRESULT_CODE(eventLogRecord.EventID), eventLogRecord.SourceName, desc) def FeedEventLogRecords(feeder, machineName = None, logName = "Application", readFlags = None): |