Title: Documentation doesn't generate with docutils >= 0.22 · Issue #139257 · python/cpython · GitHub
Open Graph Title: Documentation doesn't generate with docutils >= 0.22 · Issue #139257 · python/cpython
X Title: Documentation doesn't generate with docutils >= 0.22 · Issue #139257 · python/cpython
Description: Documentation The html doc is not building with the new docutils >= 0.22. It's not a problem yet, because the current Sphinx used (sphinx~=8.2.0) doesn't install the latest one, but it's something that should be fixed for the future. The...
Open Graph Description: Documentation The html doc is not building with the new docutils >= 0.22. It's not a problem yet, because the current Sphinx used (sphinx~=8.2.0) doesn't install the latest one, but it's something ...
X Description: Documentation The html doc is not building with the new docutils >= 0.22. It's not a problem yet, because the current Sphinx used (sphinx~=8.2.0) doesn't install the latest one, but it...
Opengraph URL: https://github.com/python/cpython/issues/139257
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Documentation doesn't generate with docutils \u003e= 0.22","articleBody":"# Documentation\n\nThe html doc is not building with the new docutils \u003e= 0.22. It's not a problem yet, because the current Sphinx used (`sphinx~=8.2.0`) doesn't install the latest one, but it's something that should be fixed for the future.\n\nThe problem can be reproduced:\n\n```\n$ cd Doc\n$ python3 -m venv env\n$ source env/bin/activate\n$ pip install -r requirements.txt\n$ pip install -U docutils\n$ sphinx-build --pdb -b html . build/html\n[...]\n File \"env/lib64/python3.13/site-packages/docutils/parsers/rst/states.py\", line 1494, in parse_enumerator\n ordinal = int(self.enum.converters[sequence](text))\n TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'\n\n```\n\nThe actual problem is directly related to [this line in docutils](https://github.com/docutils/docutils/blob/master/docutils/docutils/parsers/rst/states.py#L1494), done as part as [this commit](https://github.com/docutils/docutils/commit/91f0dde5c35631918b17054d4ff9ed18b9be065d#diff-03d1bdebd24c00f33a6c8e1fdfebca24f772c26c3de9f1d1df2854d01090867aR1385).\n\nThey wrap the converters with `int` so the monkey patch done in [pyspecific.py](https://github.com/python/cpython/blob/main/Doc/tools/extensions/pyspecific.py#L27-L32) doesn't work anymore.\n\n```\n# monkey-patch reST parser to disable alphabetic and roman enumerated lists\nfrom docutils.parsers.rst.states import Body\nBody.enum.converters['loweralpha'] = \\\n Body.enum.converters['upperalpha'] = \\\n Body.enum.converters['lowerroman'] = \\\n Body.enum.converters['upperroman'] = lambda x: None\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-139258\n* gh-140031\n* gh-142090\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/danigm","@type":"Person","name":"danigm"},"datePublished":"2025-09-23T07:34:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/139257/cpython/issues/139257"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:91252c5b-9519-0a00-b94d-cc096c5e4635 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B006:DEDFE:1CB9BD0:2625C5B:696AFC59 |
| html-safe-nonce | 0a8e5fe6dd7d3ad01b7f16b4e21ba165935f564773f80863e2d566ec9b97eea8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDA2OkRFREZFOjFDQjlCRDA6MjYyNUM1Qjo2OTZBRkM1OSIsInZpc2l0b3JfaWQiOiI3ODQ1MjE1Njk3MzI1NzE4NjE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 463e533943dacf0ba2a4bfecd5ae76742e0f4b9bf9e930a821844dff1d0d9f94 |
| hovercard-subject-tag | issue:3444070283 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/139257/issue_layout |
| twitter:image | https://opengraph.githubassets.com/331b08d39310b6dd2397b6eacc1a5facba56c675498c56188b0182bc9bf3216e/python/cpython/issues/139257 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/331b08d39310b6dd2397b6eacc1a5facba56c675498c56188b0182bc9bf3216e/python/cpython/issues/139257 |
| og:image:alt | Documentation The html doc is not building with the new docutils >= 0.22. It's not a problem yet, because the current Sphinx used (sphinx~=8.2.0) doesn't install the latest one, but it's something ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | danigm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width