diff --git a/pelican/contents.py b/pelican/contents.py index 9b6aa971..1ded6cdb 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -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 diff --git a/pelican/log.py b/pelican/log.py index fe14a29b..cec07bf0 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -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