Sun, 21 Dec 2014 18:00:20 +0100
A little change to the ReST previewer to discard errors generated by the docutils converter and sent to sys.stderr.
UI/Previewers/PreviewerHTML.py | file | annotate | diff | comparison | revisions |
--- a/UI/Previewers/PreviewerHTML.py Sun Dec 21 15:36:59 2014 +0100 +++ b/UI/Previewers/PreviewerHTML.py Sun Dec 21 18:00:20 2014 +0100 @@ -471,8 +471,13 @@ """ <a href="http://pypi.python.org/pypi/docutils">""" """this page.</a></p>""") - return docutils.core.publish_string(text, writer_name='html')\ + # redirect sys.stderr because we are not interested in it here + origStderr = sys.stderr + sys.stderr = io.StringIO() + html = docutils.core.publish_string(text, writer_name='html')\ .decode("utf-8") + sys.stderr = origStderr + return html def __convertMarkdown(self, text): """