Commit a79d6f40 authored by Vinay Sajip's avatar Vinay Sajip

Brought excluded code into the scope of a try block in SysLogHandler.emit().

parent 409062c6
...@@ -840,18 +840,18 @@ class SysLogHandler(logging.Handler): ...@@ -840,18 +840,18 @@ class SysLogHandler(logging.Handler):
The record is formatted, and then sent to the syslog server. If The record is formatted, and then sent to the syslog server. If
exception information is present, it is NOT sent to the server. exception information is present, it is NOT sent to the server.
""" """
msg = self.format(record) + '\000'
"""
We need to convert record level to lowercase, maybe this will
change in the future.
"""
prio = '<%d>' % self.encodePriority(self.facility,
self.mapPriority(record.levelname))
# Message is a string. Convert to bytes as required by RFC 5424
if type(msg) is unicode:
msg = msg.encode('utf-8')
msg = prio + msg
try: try:
msg = self.format(record) + '\000'
"""
We need to convert record level to lowercase, maybe this will
change in the future.
"""
prio = '<%d>' % self.encodePriority(self.facility,
self.mapPriority(record.levelname))
# Message is a string. Convert to bytes as required by RFC 5424
if type(msg) is unicode:
msg = msg.encode('utf-8')
msg = prio + msg
if self.unixsocket: if self.unixsocket:
try: try:
self.socket.send(msg) self.socket.send(msg)
......
...@@ -37,6 +37,9 @@ Core and Builtins ...@@ -37,6 +37,9 @@ Core and Builtins
Library Library
------- -------
- Issue #22776: Brought excluded code into the scope of a try block in
SysLogHandler.emit().
- Issue #17381: Fixed ranges handling in case-insensitive regular expressions. - Issue #17381: Fixed ranges handling in case-insensitive regular expressions.
- Issue #19329: Optimized compiling charsets in regular expressions. - Issue #19329: Optimized compiling charsets in regular expressions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment