summaryrefslogtreecommitdiff
path: root/dev-python/docutils/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /dev-python/docutils/files
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'dev-python/docutils/files')
-rw-r--r--dev-python/docutils/files/docutils-0.16-tests.patch66
-rw-r--r--dev-python/docutils/files/docutils-0.18.1-py311.patch135
2 files changed, 135 insertions, 66 deletions
diff --git a/dev-python/docutils/files/docutils-0.16-tests.patch b/dev-python/docutils/files/docutils-0.16-tests.patch
deleted file mode 100644
index 052578c727a4..000000000000
--- a/dev-python/docutils/files/docutils-0.16-tests.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Index: docutils/test/test_parsers/test_rst/test_directives/test_code.py
-===================================================================
---- docutils/test/test_parsers/test_rst/test_directives/test_code.py (revision 8494)
-+++ docutils/test/test_parsers/test_rst/test_directives/test_code.py (working copy)
-@@ -107,7 +107,7 @@
- <document source="test data">
- <literal_block classes="code python testclass" xml:space="preserve">
- \n\
-- <inline classes="keyword">
-+ <inline classes="name builtin">
- print
- <inline classes="punctuation">
- (
-@@ -167,7 +167,7 @@
- <inline classes="ln">
- 12 \n\
- \n\
-- <inline classes="keyword">
-+ <inline classes="name builtin">
- print
- <inline classes="punctuation">
- (
-Index: docutils/test/test_parsers/test_rst/test_directives/test_code_long.py
-===================================================================
---- docutils/test/test_parsers/test_rst/test_directives/test_code_long.py (revision 8494)
-+++ docutils/test/test_parsers/test_rst/test_directives/test_code_long.py (working copy)
-@@ -69,7 +69,7 @@
- <inline classes="ln">
- 12 \n\
- \n\
-- <inline classes="keyword">
-+ <inline classes="name builtin">
- print
- <inline classes="punctuation">
- (
-Index: docutils/test/test_parsers/test_rst/test_directives/test_tables.py
-===================================================================
---- docutils/test/test_parsers/test_rst/test_directives/test_tables.py (revision 8494)
-+++ docutils/test/test_parsers/test_rst/test_directives/test_tables.py (working copy)
-@@ -45,10 +45,11 @@
- # some error messages changed in Python 3.3, CPython has backported to 2.7.4,
- # PyPy has not
- csv_eod_error_str = 'unexpected end of data'
--if sys.version_info < (2,7,4) or platform.python_implementation() == 'PyPy':
-+if sys.version_info < (2,7,4) or (platform.python_implementation() == 'PyPy'
-+ and sys.version_info < (3,0)):
- csv_eod_error_str = 'newline inside string'
- # pypy adds a line number
--if sys.version_info >= (3, 0) and platform.python_implementation() == 'PyPy':
-+if platform.python_implementation() == 'PyPy':
- csv_eod_error_str = 'line 1: ' + csv_eod_error_str
- csv_unknown_url = "'bogus.csv'"
- if sys.version_info < (3, 0):
-Index: docutils/test/test_parsers/test_rst/test_interpreted.py
-===================================================================
---- docutils/test/test_parsers/test_rst/test_interpreted.py (revision 8494)
-+++ docutils/test/test_parsers/test_rst/test_interpreted.py (working copy)
-@@ -283,7 +283,7 @@
- <paragraph>
- Python code \n\
- <literal classes="code testclass python">
-- <inline classes="keyword">
-+ <inline classes="name builtin">
- print
- <inline classes="punctuation">
- (
diff --git a/dev-python/docutils/files/docutils-0.18.1-py311.patch b/dev-python/docutils/files/docutils-0.18.1-py311.patch
new file mode 100644
index 000000000000..878c6f1961db
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.18.1-py311.patch
@@ -0,0 +1,135 @@
+Combination of:
+http://svn.code.sf.net/p/docutils/code/trunk@8910
+http://svn.code.sf.net/p/docutils/code/trunk@8909
+
+diff --git a/test/DocutilsTestSupport.py b/test/DocutilsTestSupport.py
+index 592d3f9df..e1f33aa7a 100644
+--- a/test/DocutilsTestSupport.py
++++ b/test/DocutilsTestSupport.py
+@@ -819,6 +819,7 @@ def exception_data(func, *args, **kwds):
+ except Exception as detail:
+ return (detail, detail.args,
+ '%s: %s' % (detail.__class__.__name__, detail))
++ return None, [], "No exception"
+
+
+ def _format_str(*args):
+diff --git a/test/test_parsers/test_rst/test_directives/test_tables.py b/test/test_parsers/test_rst/test_directives/test_tables.py
+index 07be0122f..73724ed7e 100755
+--- a/test/test_parsers/test_rst/test_directives/test_tables.py
++++ b/test/test_parsers/test_rst/test_directives/test_tables.py
+@@ -65,6 +65,92 @@ def null_bytes():
+ next(reader)
+
+ null_bytes_exception = DocutilsTestSupport.exception_data(null_bytes)[0]
++# Null bytes are valid in Python 3.11+:
++if null_bytes_exception is None:
++ bad_encoding_result = """\
++<document source="test data">
++ <table>
++ <title>
++ bad encoding
++ <tgroup cols="4">
++ <colspec colwidth="25">
++ <colspec colwidth="25">
++ <colspec colwidth="25">
++ <colspec colwidth="25">
++ <tbody>
++ <row>
++ <entry>
++ <paragraph>
++ \xfe\xff"Treat"
++ <entry>
++ <paragraph>
++ "Quantity"
++ <entry>
++ <paragraph>
++ "Description"
++ <entry>
++ <row>
++ <entry>
++ <paragraph>
++ "Albatr\u00b0\u00df"
++ <entry>
++ <paragraph>
++ 2.99
++ <entry>
++ <paragraph>
++ "\u00a1Ona\x03\xc3\x03\xc4\x03\xb9\x03\xba!"
++ <entry>
++ <row>
++ <entry>
++ <paragraph>
++ "CrunchyFrog"
++ <entry>
++ <paragraph>
++ 1.49
++ <entry>
++ <paragraph>
++ "Ifwetooktheb\u00f6nesout
++ <entry>
++ <paragraph>
++ itwouldn\x20\x19tbe
++ <row>
++ <entry>
++ <paragraph>
++ crunchy
++ <entry>
++ <paragraph>
++ nowwouldit?"
++ <entry>
++ <entry>
++ <row>
++ <entry>
++ <paragraph>
++ "GannetRipple"
++ <entry>
++ <paragraph>
++ 1.99
++ <entry>
++ <paragraph>
++ "\xbfOna\x03\xc3\x03\xc4\x03\xb9\x03\xba?"
++ <entry>
++ <paragraph>
++ (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
++"""
++else:
++ bad_encoding_result = """\
++<document source="test data">
++ <system_message level="3" line="1" source="test data" type="ERROR">
++ <paragraph>
++ Error with CSV data in "csv-table" directive:
++ %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.)
++""" % (null_bytes_exception, utf_16_csv)
++
+
+ totest = {}
+
+@@ -1031,19 +1117,8 @@ u"""\
+
+ (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
+ """ % utf_16_csv,
+-"""\
+-<document source="test data">
+- <system_message level="3" line="1" source="test data" type="ERROR">
+- <paragraph>
+- Error with CSV data in "csv-table" directive:
+- %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.)
+-""" % (null_bytes_exception, utf_16_csv)],
++bad_encoding_result
++],
+ ["""\
+ .. csv-table:: good encoding
+ :file: %s