File: docutils-0.22

package info (click to toggle)
python3.13 3.13.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,784 kB
  • sloc: python: 705,286; ansic: 654,530; xml: 31,250; sh: 5,844; cpp: 4,326; makefile: 1,981; objc: 787; lisp: 502; javascript: 213; asm: 75; csh: 12
file content (135 lines) | stat: -rw-r--r-- 3,331 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Description: Support docutils 0.22
Origin: https://github.com/python/cpython/pull/139258 and https://github.com/python/cpython/pull/140031
Bug-Upstream: https://github.com/python/cpython/issues/139257
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -25,11 +25,21 @@
 SOURCE_URI = 'https://github.com/python/cpython/tree/3.13/%s'
 
 # monkey-patch reST parser to disable alphabetic and roman enumerated lists
+def _disable_alphabetic_and_roman(text):
+    try:
+        # docutils >= 0.22
+        from docutils.parsers.rst.states import InvalidRomanNumeralError
+        raise InvalidRomanNumeralError(text)
+    except ImportError:
+        # docutils < 0.22
+        return None
+
+
 from docutils.parsers.rst.states import Body
 Body.enum.converters['loweralpha'] = \
     Body.enum.converters['upperalpha'] = \
     Body.enum.converters['lowerroman'] = \
-    Body.enum.converters['upperroman'] = lambda x: None
+    Body.enum.converters['upperroman'] = _disable_alphabetic_and_roman
 
 
 class PyAwaitableMixin(object):
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -2,9 +2,7 @@
 Design and History FAQ
 ======================
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 
 Why does Python use indentation for grouping of statements?
--- a/Doc/faq/extending.rst
+++ b/Doc/faq/extending.rst
@@ -2,9 +2,7 @@
 Extending/Embedding FAQ
 =======================
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 .. highlight:: c
 
--- a/Doc/faq/general.rst
+++ b/Doc/faq/general.rst
@@ -4,9 +4,7 @@
 General Python FAQ
 ==================
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 
 General Information
--- a/Doc/faq/gui.rst
+++ b/Doc/faq/gui.rst
@@ -4,9 +4,7 @@
 Graphic User Interface FAQ
 ==========================
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 .. XXX need review for Python 3.
 
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -4,9 +4,7 @@
 Library and Extension FAQ
 =========================
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 General Library Questions
 =========================
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -4,9 +4,7 @@
 Programming FAQ
 ===============
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 General Questions
 =================
--- a/Doc/faq/windows.rst
+++ b/Doc/faq/windows.rst
@@ -8,9 +8,7 @@
 Python on Windows FAQ
 =====================
 
-.. only:: html
-
-   .. contents::
+.. contents::
 
 .. XXX need review for Python 3.
    XXX need review for Windows Vista/Seven?
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -15,9 +15,11 @@
     You may also find useful the following article on fetching web resources
     with Python:
 
-    * `Basic Authentication <https://web.archive.org/web/20201215133350/http://www.voidspace.org.uk/python/articles/authentication.shtml>`_
+    * `Basic Authentication`_
 
-        A tutorial on *Basic Authentication*, with examples in Python.
+      A tutorial on *Basic Authentication*, with examples in Python.
+
+.. _Basic Authentication: https://web.archive.org/web/20201215133350/http://www.voidspace.org.uk/python/articles/authentication.shtml
 
 **urllib.request** is a Python module for fetching URLs
 (Uniform Resource Locators). It offers a very simple interface, in the form of