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
6f5e54e7
Commit
6f5e54e7
authored
Mar 29, 2012
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #14436: Convert msg + args to string before pickling.
parent
67ac0792
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
Lib/logging/handlers.py
Lib/logging/handlers.py
+10
-5
No files found.
Lib/logging/handlers.py
View file @
6f5e54e7
...
...
@@ -519,11 +519,16 @@ class SocketHandler(logging.Handler):
"""
ei
=
record
.
exc_info
if
ei
:
dummy
=
self
.
format
(
record
)
# just to get traceback text into record.exc_text
record
.
exc_info
=
None
# to avoid Unpickleable error
s
=
pickle
.
dumps
(
record
.
__dict__
,
1
)
if
ei
:
record
.
exc_info
=
ei
# for next handler
# just to get traceback text into record.exc_text ...
dummy
=
self
.
format
(
record
)
# See issue #14436: If msg or args are objects, they may not be
# available on the receiving end. So we convert the msg % args
# to a string, save it as msg and zap the args.
d
=
dict
(
record
.
__dict__
)
d
[
'msg'
]
=
record
.
getMessage
()
d
[
'args'
]
=
None
d
[
'exc_info'
]
=
None
s
=
pickle
.
dumps
(
d
,
1
)
slen
=
struct
.
pack
(
">L"
,
len
(
s
))
return
slen
+
s
...
...
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