mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #2040 from avaris/exception_logging_fixes
Fixes Exception name related bugs
This commit is contained in:
commit
594b9c9633
2 changed files with 3 additions and 2 deletions
|
|
@ -473,5 +473,6 @@ def is_valid_content(content, f):
|
|||
return True
|
||||
except NameError as e:
|
||||
logger.error(
|
||||
"Skipping %s: could not find information about '%s'", f, e)
|
||||
"Skipping %s: could not find information about '%s'",
|
||||
f, six.text_type(e))
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class SafeLogger(logging.Logger):
|
|||
so convert the message to unicode with the correct encoding
|
||||
'''
|
||||
if isinstance(arg, Exception):
|
||||
text = '%s: %s' % (arg.__class__.__name__, arg)
|
||||
text = str('%s: %s') % (arg.__class__.__name__, arg)
|
||||
if six.PY2:
|
||||
text = text.decode(self._exc_encoding)
|
||||
return text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue