summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Cakebread <pythonhead@gentoo.org>2007-04-04 18:28:41 +0000
committerRob Cakebread <pythonhead@gentoo.org>2007-04-04 18:28:41 +0000
commitc6e4453ae61960f2a4f1864372fbdeb748a27a93 (patch)
treed4260adb3148e4e57e2b37582583c15f15eac58a /dev-python/docutils
parentx86 stable wrt bug 173376 (diff)
downloadgentoo-2-c6e4453ae61960f2a4f1864372fbdeb748a27a93.tar.gz
gentoo-2-c6e4453ae61960f2a4f1864372fbdeb748a27a93.tar.bz2
gentoo-2-c6e4453ae61960f2a4f1864372fbdeb748a27a93.zip
Python 2.5 test fix bug 172557. Thanks Ali Polatel <polatel@gmail.com>. Also removed non-existent spec dir from dodoc
(Portage version: 2.1.2.3)
Diffstat (limited to 'dev-python/docutils')
-rw-r--r--dev-python/docutils/ChangeLog8
-rw-r--r--dev-python/docutils/docutils-0.4-r1.ebuild8
-rw-r--r--dev-python/docutils/docutils-0.4.ebuild8
-rw-r--r--dev-python/docutils/files/docutils-0.4-python-2.5-fix.patch132
4 files changed, 149 insertions, 7 deletions
diff --git a/dev-python/docutils/ChangeLog b/dev-python/docutils/ChangeLog
index 28a78cc6c54c..88f89ecf813c 100644
--- a/dev-python/docutils/ChangeLog
+++ b/dev-python/docutils/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-python/docutils
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/ChangeLog,v 1.60 2007/03/30 19:07:38 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/ChangeLog,v 1.61 2007/04/04 18:28:41 pythonhead Exp $
+
+ 04 Apr 2007; Rob Cakebread <pythonhead@gentoo.org>
+ +files/docutils-0.4-python-2.5-fix.patch, docutils-0.4.ebuild,
+ docutils-0.4-r1.ebuild:
+ Python 2.5 test fix bug 172557. Thanks Ali Polatel <polatel@gmail.com>. Also
+ removed non-existent spec dir from dodoc
30 Mar 2007; Fabian Groffen <grobian@gentoo.org> docutils-0.3.5.ebuild,
docutils-0.3.7.ebuild, docutils-0.3.9.ebuild, docutils-0.4.ebuild,
diff --git a/dev-python/docutils/docutils-0.4-r1.ebuild b/dev-python/docutils/docutils-0.4-r1.ebuild
index ae5c1283a1d3..4fdce2a70d22 100644
--- a/dev-python/docutils/docutils-0.4-r1.ebuild
+++ b/dev-python/docutils/docutils-0.4-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/docutils-0.4-r1.ebuild,v 1.3 2007/03/30 19:07:38 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/docutils-0.4-r1.ebuild,v 1.4 2007/04/04 18:28:41 pythonhead Exp $
inherit distutils eutils elisp-common multilib
@@ -27,6 +27,8 @@ src_unpack() {
# simplified algorithm to select installing optparse and textwrap
cd ${S}
epatch ${FILESDIR}/${EMP}-extramodules.patch
+ # Fix for Python 2.5 test (bug# 172557)
+ epatch ${FILESDIR}/${P}-python-2.5-fix.patch
}
src_compile() {
@@ -81,11 +83,11 @@ src_install() {
done
# Docs
cd ${S}
- dohtml -r docs spec tools
+ dohtml -r docs tools
# manually install the stylesheet file
insinto /usr/share/doc/${PF}/html
doins docutils/writers/html4css1/html4css1.css
- for doc in $(find docs spec tools -name '*.txt')
+ for doc in $(find docs tools -name '*.txt')
do
install_txt_doc $doc
done
diff --git a/dev-python/docutils/docutils-0.4.ebuild b/dev-python/docutils/docutils-0.4.ebuild
index 297ee431c208..cdcda975a769 100644
--- a/dev-python/docutils/docutils-0.4.ebuild
+++ b/dev-python/docutils/docutils-0.4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/docutils-0.4.ebuild,v 1.13 2007/03/30 19:07:38 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/docutils-0.4.ebuild,v 1.14 2007/04/04 18:28:41 pythonhead Exp $
inherit distutils eutils elisp-common multilib
@@ -27,6 +27,8 @@ src_unpack() {
# simplified algorithm to select installing optparse and textwrap
cd ${S}
epatch ${FILESDIR}/${EMP}-extramodules.patch
+ # Fix for Python 2.5 test (bug# 172557)
+ epatch ${FILESDIR}/${P}-python-2.5-fix.patch
}
src_compile() {
@@ -81,11 +83,11 @@ src_install() {
done
# Docs
cd ${S}
- dohtml -r docs spec tools
+ dohtml -r docs tools
# manually install the stylesheet file
insinto /usr/share/doc/${PF}/html
doins docutils/writers/html4css1/html4css1.css
- for doc in $(find docs spec tools -name '*.txt')
+ for doc in $(find docs tools -name '*.txt')
do
install_txt_doc $doc
done
diff --git a/dev-python/docutils/files/docutils-0.4-python-2.5-fix.patch b/dev-python/docutils/files/docutils-0.4-python-2.5-fix.patch
new file mode 100644
index 000000000000..5bc0f6a7fbef
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.4-python-2.5-fix.patch
@@ -0,0 +1,132 @@
+Index: test/alltests.py
+===================================================================
+--- test/alltests.py (revision 4628)
++++ test/alltests.py (revision 4631)
+@@ -19,21 +19,10 @@
+
+ import sys
+ import os
+-from types import UnicodeType
+ import DocutilsTestSupport # must be imported before docutils
+ import docutils
+
+
+-def new_exception_str(self):
+- for i in self.args:
+- if isinstance(i, UnicodeType):
+- raise RuntimeError('Error (unicode): %r' % (self.args,))
+- return old_exception_str(self)
+-
+-old_exception_str = Exception.__str__
+-Exception.__str__ = new_exception_str
+-
+-
+ class Tee:
+
+ """Write to a file and a stream (default: stdout) simultaneously."""
+Index: test/test_parsers/test_rst/test_directives/test_images.py
+===================================================================
+--- test/test_parsers/test_rst/test_directives/test_images.py (revision 4628)
++++ test/test_parsers/test_rst/test_directives/test_images.py (revision 4631)
+@@ -245,11 +245,11 @@
+ <paragraph>
+ Error in "image" directive:
+ invalid option value: (option: "scale"; value: 'fifty')
+- invalid literal for int(): fifty.
++ %s.
+ <literal_block xml:space="preserve">
+ .. image:: picture.png
+ :scale: fifty
+-"""],
++""" % DocutilsTestSupport.exception_data('int("fifty")')[1][0]],
+ ["""\
+ .. image:: picture.png
+ :scale: 50
+Index: test/test_parsers/test_rst/test_directives/test_contents.py
+===================================================================
+--- test/test_parsers/test_rst/test_directives/test_contents.py (revision 4628)
++++ test/test_parsers/test_rst/test_directives/test_contents.py (revision 4631)
+@@ -151,11 +151,11 @@
+ <paragraph>
+ Error in "contents" directive:
+ invalid option value: (option: "depth"; value: 'two')
+- invalid literal for int(): two.
++ %s.
+ <literal_block xml:space="preserve">
+ .. contents::
+ :depth: two
+-"""],
++""" % DocutilsTestSupport.exception_data('int("two")')[1][0]],
+ ["""\
+ .. contents::
+ :width: 2
+Index: test/test_parsers/test_rst/test_directives/test_tables.py
+===================================================================
+--- test/test_parsers/test_rst/test_directives/test_tables.py (revision 4628)
++++ test/test_parsers/test_rst/test_directives/test_tables.py (revision 4631)
+@@ -34,6 +34,16 @@
+ else:
+ unichr_exception_string = str(unichr_exception)
+
++null_bytes_code = """
++import csv
++import cStringIO
++csv_data = open('%s', 'rb').read().decode('latin-1')
++csv_file = cStringIO.StringIO(csv_data)
++reader = csv.reader(csv_file)
++reader.next()
++""" % utf_16_csv
++null_bytes_exception = DocutilsTestSupport.exception_data(null_bytes_code)[1][0]
++
+ totest = {}
+
+ totest['table'] = [
+@@ -549,7 +559,7 @@
+ <paragraph>
+ Error in "csv-table" directive:
+ invalid option value: (option: "widths"; value: '10,y,z')
+- invalid literal for int(): y.
++ %s.
+ <literal_block xml:space="preserve">
+ .. csv-table:: bad column widths
+ :widths: 10,y,z
+@@ -565,7 +575,7 @@
+ :widths: 0 0 0
+ \n\
+ some, csv, data
+-"""],
++""" % DocutilsTestSupport.exception_data('int("y")')[1][0]],
+ ["""\
+ .. csv-table:: good delimiter
+ :delim: /
+@@ -734,14 +744,14 @@
+ <system_message level="3" line="1" source="test data" type="ERROR">
+ <paragraph>
+ Error with CSV data in "csv-table" directive:
+- string with NUL bytes
++ %s
+ <literal_block xml:space="preserve">
+ .. csv-table:: bad encoding
+ :file: %s
+ :encoding: latin-1
+ <paragraph>
+ (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
+-""" % utf_16_csv],
++""" % (null_bytes_exception, utf_16_csv)],
+ ["""\
+ .. csv-table:: good encoding
+ :file: %s
+Index: docutils/parsers/rst/directives/tables.py
+===================================================================
+--- docutils/parsers/rst/directives/tables.py (revision 4628)
++++ docutils/parsers/rst/directives/tables.py (revision 4631)
+@@ -259,7 +259,8 @@
+
+ def parse_csv_data_into_rows(csv_data, dialect, source, options):
+ # csv.py doesn't do Unicode; encode temporarily as UTF-8
+- csv_reader = csv.reader([line.encode('utf-8') for line in csv_data],
++ csv_reader = csv.reader([(line.encode('utf-8') + '\n')
++ for line in csv_data],
+ dialect=dialect)
+ rows = []
+ max_cols = 0