I am working on a CMS in Python that uses reStructuredText (via docutils) to format the content. One of my content is imported from other sources and usually comes in the form of plain text documents. reST works great for this because by default everything looks really normal.
One of the problems that I encountered is that I get warnings that are dumped on stderr on my web server and are entered into my page content . For example, on my webpage I receive the following warnings:
System message: WARNING / 2 (, line 296); Feedback
My question is: How do I suppress, disable, or otherwise redirect these warnings?
Ideally, I would like to write them to a log file, but if someone can just tell me how to disable warnings from entering my content, then that would be perfect.
The code that is responsible for parsing reST in HTML:
from docutils import core import reSTpygments def reST2HTML( str ): parts = core.publish_parts( source = str, writer_name = 'html') return parts['body_pre_docinfo'] + parts['fragment']
python restructuredtext docutils
Charles hooper
source share