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
9a11b296
Commit
9a11b296
authored
Oct 24, 2011
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #13232: Handle multiple encodings in exception logging.
parent
99e93d2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Lib/logging/__init__.py
Lib/logging/__init__.py
+6
-2
No files found.
Lib/logging/__init__.py
View file @
9a11b296
...
...
@@ -478,8 +478,12 @@ class Formatter(object):
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
())
# See issue 8924.
# We also use replace for when there are multiple
# encodings, e.g. UTF-898 for the filesystem and latin-1
# for a script. See issue 13232.
s
=
s
+
record
.
exc_text
.
decode
(
sys
.
getfilesystemencoding
(),
'replace'
)
return
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