Update to the previous fixes -- I scratch built this on F14 by mistake

so there were more things to change.
This commit is contained in:
Toshio Kuratomi 2011-05-17 23:10:37 -07:00
parent 8cb9a4d2a7
commit 985c740cb3
2 changed files with 31 additions and 0 deletions

View File

@ -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

View File

@ -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.