From 53adf257e2f480a5f28b0292dd8da00a5d24fb5f Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Aug 14 2012 16:14:19 +0000 Subject: PyXML patch from upstream - Fix ability to disable python3 builds --- diff --git a/docutils-0.9.1-pyxml-upstream.patch b/docutils-0.9.1-pyxml-upstream.patch new file mode 100644 index 0000000..27df368 --- /dev/null +++ b/docutils-0.9.1-pyxml-upstream.patch @@ -0,0 +1,23 @@ +diff -up docutils-0.10/docutils/writers/docutils_xml.py.bak docutils-0.10/docutils/writers/docutils_xml.py +--- docutils-0.10/docutils/writers/docutils_xml.py.bak 2012-07-30 20:57:20.000000000 -0700 ++++ docutils-0.10/docutils/writers/docutils_xml.py 2012-08-14 07:51:20.389219183 -0700 +@@ -11,6 +11,19 @@ http://docutils.sourceforge.net/docs/ref + __docformat__ = 'reStructuredText' + + import sys ++ ++# Work around broken PyXML and obsolete python stdlib behaviour (The ++# stdlib replaces its own xml module with the unmaintained PyXML if PyXML ++# is installed.) 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 + diff --git a/docutils-0.9.1-pyxml.patch b/docutils-0.9.1-pyxml.patch deleted file mode 100644 index 97092c3..0000000 --- a/docutils-0.9.1-pyxml.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up docutils-0.10/docutils/__init__.py.bak docutils-0.10/docutils/__init__.py ---- docutils-0.10/docutils/__init__.py.bak 2012-07-30 21:10:28.157575978 -0700 -+++ docutils-0.10/docutils/__init__.py 2012-07-30 21:15:54.367394309 -0700 -@@ -63,6 +63,14 @@ __version_details__ = 'repository' - """Extra version details (e.g. 'snapshot 2005-05-29, r3410', 'repository', - 'release'), modified automatically & manually.""" - -+# Work around broken PyXML and dubious python stdlib behaviour (The stdlib -+# replaces its own xml module with PyXML if PyXML is installed.) -+# This reverses the order that the xml module and submodules are searched -- -+# it finds the stdlib modules first if they exist and then the PyXML modules -+# if they didn't exist in the stdlib. -+import xml -+xml.__path__.reverse() # If both are available, prefer stdlib over PyXML -+ - import sys - - class ApplicationError(StandardError): diff --git a/python-docutils.spec b/python-docutils.spec index f2be447..92a3e4e 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -11,7 +11,7 @@ Name: python-%{srcname} Version: 0.10 -Release: 0.2.20120730svn7490%{?dist} +Release: 0.3.20120730svn7490%{?dist} Summary: System for processing plaintext documentation Group: Development/Languages @@ -25,7 +25,8 @@ URL: http://docutils.sourceforge.net # python setup.py sdist # The tarball is in dist/docutils-VERSION.tar.gz Source0: %{srcname}-%{version}.tar.gz -Patch0: docutils-0.9.1-pyxml.patch +# Upstream provided patch for pyxml issue +Patch0: docutils-0.9.1-pyxml-upstream.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -153,13 +154,19 @@ rm -rf %{buildroot} %{_bindir}/* %{python_sitelib}/* +%if 0%{?with_python3} %files -n python3-%{srcname} %defattr(-,root,root,-) %doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt %doc THANKS.txt licenses docs tools/editors %{python3_sitelib}/* +%endif %changelog +* Tue Aug 14 2012 Toshio Kuratomi - 0.10-0.3.20120730svn7490 +- PyXML patch from upstream +- Fix ability to disable python3 builds + * Fri Aug 3 2012 David Malcolm - 0.10-0.2.20120730svn7490 - remove rhel logic from with_python3 conditional