#14680·sphinx

Docutils 1.0 的开发变更破坏了原生的 doctest 和表格宽度

作者: Darlokt创建于 2026年9月13日更新于 2026年9月19日
标签type:bugdocutils

如何重现问题

运行以下命令:

bash
uv sync
uv run --no-sync --with \
  'docutils @ git+https://repo.or.cz/docutils.git@335c924f838ac9180231cf2164f301cc6f6b4ca1#subdirectory=docutils' \
  pytest -q --tb=short \
  tests/test_builders/test_build_text.py::test_lineblock \
  tests/test_extensions/test_ext_doctest.py::test_highlight_language_default \
  tests/test_ext_autosummary/test_ext_autosummary.py::test_escaping

运行后,将产生三个失败的测试,并返回退出代码 1:

  • 文本编写器在合并整数和字符串列宽时失败
  • doctest 高亮测试在 KeyError: 'language' 时失败
  • XML 编写器在处理 autosummary 的整数 colwidth 时失败

内容来源: sphinx-doc/sphinx