From 985c740cb382fb17d71506fc5f346826f4849949 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 17 May 2011 23:10:37 -0700 Subject: [PATCH] Update to the previous fixes -- I scratch built this on F14 by mistake so there were more things to change. --- docutils-test-io-exception.patch | 29 +++++++++++++++++++++++++++++ python-docutils.spec | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 docutils-test-io-exception.patch diff --git a/docutils-test-io-exception.patch b/docutils-test-io-exception.patch new file mode 100644 index 0000000..c6e2054 --- /dev/null +++ b/docutils-test-io-exception.patch @@ -0,0 +1,29 @@ +Index: docutils/test/test_functional.py +=================================================================== +--- docutils/test/test_functional.py (revision 7036) ++++ docutils/test/test_functional.py (working copy) +@@ -171,7 +171,10 @@ + no_expected = self.no_expected_template % { + 'exp': expected_path, 'out': params['destination_path']} + self.assert_(os.access(expected_path, os.R_OK), no_expected) +- f = open(expected_path, 'r') # ! 'rb' leads to errors with Python 3! ++ if sys.version_info < (3,0): ++ f = open(expected_path, 'r') ++ else: ++ f = open(expected_path, 'r', encoding='utf-8') # ! 'rb' leads to errors with Python 3! + # Normalize line endings: + expected = '\n'.join(f.read().splitlines()) + f.close() +Index: docutils/test/test_io.py +=================================================================== +--- docutils/test/test_io.py (revision 7036) ++++ docutils/test/test_io.py (working copy) +@@ -99,7 +99,7 @@ + except UnicodeEncodeError: + try: + open(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) +- except IOError: ++ except IOError, e: + uioe = e + if locale: + locale.setlocale(locale.LC_ALL, 'C') # reset diff --git a/python-docutils.spec b/python-docutils.spec index 0cc750e..99f7583 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -25,6 +25,7 @@ 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-test-io-exception.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -73,6 +74,7 @@ This package contains the module, ported to run under python3. %prep %setup -q -n %{srcname}-%{version} +%patch0 -p1 -b .testio # We want to check if this is necessary every time we rebuild # since it is icky, nasty, and gross.