File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -766,14 +766,18 @@ def mapPriority(self, levelName):
766766 """
767767 return self .priority_map .get (levelName , "warning" )
768768
769+ append_nul = True # some old syslog daemons expect a NUL terminator
770+
769771 def emit (self , record ):
770772 """
771773 Emit a record.
772774
773775 The record is formatted, and then sent to the syslog server. If
774776 exception information is present, it is NOT sent to the server.
775777 """
776- msg = self .format (record ) + '\000 '
778+ msg = self .format (record )
779+ if self .append_nul :
780+ msg += '\000 '
777781 """
778782 We need to convert record level to lowercase, maybe this will
779783 change in the future.
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ Core and Builtins
2222Library
2323-------
2424
25+ - Issue #12168: SysLogHandler now allows NUL termination to be controlled using
26+ a new 'append_nul' attribute on the handler.
27+
2528- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
2629 instead of os.stat.
2730
You can’t perform that action at this time.
0 commit comments