From: <mi...@us...> - 2012-08-16 15:17:35
|
Revision: 7497 http://docutils.svn.sourceforge.net/docutils/?rev=7497&view=rev Author: milde Date: 2012-08-16 15:17:29 +0000 (Thu, 16 Aug 2012) Log Message: ----------- Fix [ 3552403 ] Prevent broken PyXML replacing stdlibs xml module. Modified Paths: -------------- trunk/docutils/HISTORY.txt trunk/docutils/docutils/writers/docutils_xml.py Modified: trunk/docutils/HISTORY.txt =================================================================== --- trunk/docutils/HISTORY.txt 2012-08-16 15:11:18 UTC (rev 7496) +++ trunk/docutils/HISTORY.txt 2012-08-16 15:17:29 UTC (rev 7497) @@ -45,7 +45,11 @@ - Fix [ 3556388 ] Mathjax does not work with rst2s5. +* docutils/writers/s5_html/docutils_xml.py + - Fix [ 3552403 ] Prevent broken PyXML replacing stdlibs xml module. + + Release 0.9.1 (2012-06-17) ========================== Modified: trunk/docutils/docutils/writers/docutils_xml.py =================================================================== --- trunk/docutils/docutils/writers/docutils_xml.py 2012-08-16 15:11:18 UTC (rev 7496) +++ trunk/docutils/docutils/writers/docutils_xml.py 2012-08-16 15:17:29 UTC (rev 7497) @@ -11,6 +11,19 @@ __docformat__ = 'reStructuredText' import sys + +# Work around broken PyXML and obsolete python stdlib behaviour. (The stdlib +# replaces its own xml module with PyXML if the latter is installed. However, +# PyXML is no longer maintained and partially incompatible/buggy.) Reverse +# the order in which xml module and submodules are searched to import stdlib +# modules if they exist and PyXML modules if they do not exist in the stdlib. +# +# See http://sourceforge.net/tracker/index.php?func=detail&aid=3552403&group_id=38414&atid=422030 +# and http://lists.fedoraproject.org/pipermail/python-devel/2012-July/000406.html +import xml +if "_xmlplus" in xml.__path__[0]: # PyXML sub-module + xml.__path__.reverse() # If both are available, prefer stdlib over PyXML + import xml.sax.saxutils from StringIO import StringIO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |