mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #767: safely encode SphinxErrors when printing to sys.stderr.
This commit is contained in:
@@ -209,7 +209,7 @@ def main(argv):
|
||||
print >>error, err.args[0].encode('ascii', 'backslashreplace')
|
||||
elif isinstance(err, SphinxError):
|
||||
print >>error, red('%s:' % err.category)
|
||||
print >>error, err
|
||||
print >>error, unicode(err).encode('ascii', 'backslashreplace')
|
||||
else:
|
||||
print >>error, red('Exception occurred:')
|
||||
print >>error, format_exception_cut_frames().rstrip()
|
||||
|
||||
Reference in New Issue
Block a user