File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -879,21 +879,21 @@ def emit(self, record):
879879 The record is formatted, and then sent to the syslog server. If
880880 exception information is present, it is NOT sent to the server.
881881 """
882- msg = self .format (record )
883- if self .ident :
884- msg = self .ident + msg
885- if self .append_nul :
886- msg += '\000 '
887-
888- # We need to convert record level to lowercase, maybe this will
889- # change in the future.
890- prio = '<%d>' % self .encodePriority (self .facility ,
891- self .mapPriority (record .levelname ))
892- prio = prio .encode ('utf-8' )
893- # Message is a string. Convert to bytes as required by RFC 5424
894- msg = msg .encode ('utf-8' )
895- msg = prio + msg
896882 try :
883+ msg = self .format (record )
884+ if self .ident :
885+ msg = self .ident + msg
886+ if self .append_nul :
887+ msg += '\000 '
888+
889+ # We need to convert record level to lowercase, maybe this will
890+ # change in the future.
891+ prio = '<%d>' % self .encodePriority (self .facility ,
892+ self .mapPriority (record .levelname ))
893+ prio = prio .encode ('utf-8' )
894+ # Message is a string. Convert to bytes as required by RFC 5424
895+ msg = msg .encode ('utf-8' )
896+ msg = prio + msg
897897 if self .unixsocket :
898898 try :
899899 self .socket .send (msg )
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ Core and Builtins
3333Library
3434-------
3535
36+ - Issue #22776: Brought excluded code into the scope of a try block in
37+ SysLogHandler.emit().
38+
3639- Issue #22665: Add missing get_terminal_size and SameFileError to
3740 shutil.__all__.
3841
You can’t perform that action at this time.
0 commit comments