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
f753d336
Commit
f753d336
authored
Jun 11, 2010
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #8924: logging: Improved error handling for Unicode in exception text.
parent
4595e518
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
Lib/logging/__init__.py
Lib/logging/__init__.py
+7
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/logging/__init__.py
View file @
f753d336
...
...
@@ -445,7 +445,13 @@ class Formatter:
if
record
.
exc_text
:
if
s
[
-
1
:]
!=
"
\
n
"
:
s
=
s
+
"
\
n
"
s
=
s
+
record
.
exc_text
try
:
s
=
s
+
record
.
exc_text
except
UnicodeError
:
# Sometimes filenames have non-ASCII chars, which can lead
# to errors when s is Unicode and record.exc_text is str
# See issue 8924
s
=
s
+
record
.
exc_text
.
decode
(
sys
.
getfilesystemencoding
())
return
s
#
...
...
Misc/NEWS
View file @
f753d336
...
...
@@ -71,6 +71,8 @@ C-API
Library
-------
- Issue #8924: logging: Improved error handling for Unicode in exception text.
- Fix codecs.escape_encode to return the correct consumed size.
- Issue #6470: Drop UNC prefix in FixTk.
...
...
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