Fixes Exception name related bugs

Fixes two bugs that was introduced by #1743:

 - First was the unnecessary exception name output when skipping
content files if a required metadata wasn't available.
It was
`ERROR: Skipping ./demo.rst: could not find information about 'NameError: date'`
and now should be
`ERROR: Skipping ./demo.rst: could not find information about 'date'`

 - Second was a more serious issue. Improper string formatting in the logger
resulted in implicit decoding and would break for non-ascii error messages.
This commit is contained in:
Deniz Turgut 2016-10-29 14:04:13 -04:00
commit a8be1b562e
2 changed files with 3 additions and 2 deletions

View file

@ -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