Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1be0c618
Commit
1be0c618
authored
Nov 01, 2014
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Plain Diff
Closes #22776: Merged fix from 3.4.
parents
8be6fac1
c33a0cc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
Lib/logging/handlers.py
Lib/logging/handlers.py
+14
-14
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/logging/handlers.py
View file @
1be0c618
...
...
@@ -879,21 +879,21 @@ class SysLogHandler(logging.Handler):
The record is formatted, and then sent to the syslog server. If
exception information is present, it is NOT sent to the server.
"""
msg
=
self
.
format
(
record
)
if
self
.
ident
:
msg
=
self
.
ident
+
msg
if
self
.
append_nul
:
msg
+=
'
\
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
))
prio
=
prio
.
encode
(
'utf-8'
)
# Message is a string. Convert to bytes as required by RFC 5424
msg
=
msg
.
encode
(
'utf-8'
)
msg
=
prio
+
msg
try
:
msg
=
self
.
format
(
record
)
if
self
.
ident
:
msg
=
self
.
ident
+
msg
if
self
.
append_nul
:
msg
+=
'
\
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
))
prio
=
prio
.
encode
(
'utf-8'
)
# Message is a string. Convert to bytes as required by RFC 5424
msg
=
msg
.
encode
(
'utf-8'
)
msg
=
prio
+
msg
if
self
.
unixsocket
:
try
:
self
.
socket
.
send
(
msg
)
...
...
Misc/NEWS
View file @
1be0c618
...
...
@@ -180,6 +180,9 @@ Core and Builtins
Library
-------
-
Issue
#
22776
:
Brought
excluded
code
into
the
scope
of
a
try
block
in
SysLogHandler
.
emit
().
-
Issue
#
22665
:
Add
missing
get_terminal_size
and
SameFileError
to
shutil
.
__all__
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment