summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-14 09:50:52 +0200
committerMichał Górny <mgorny@gentoo.org>2022-05-14 10:25:50 +0200
commit65f03f171fac890573267be3554f7256975a6b10 (patch)
treeb622607d177b083077f65417620c694c303d4669 /dev-python/docutils/files
parentdev-python/docutils: Use PEP517 build (diff)
downloadgentoo-65f03f171fac890573267be3554f7256975a6b10.tar.gz
gentoo-65f03f171fac890573267be3554f7256975a6b10.tar.bz2
gentoo-65f03f171fac890573267be3554f7256975a6b10.zip
dev-python/docutils: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/docutils/files')
-rw-r--r--dev-python/docutils/files/docutils-0.18.1-py311.patch135
1 files changed, 135 insertions, 0 deletions
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