sphinx-book-theme icon indicating copy to clipboard operation
sphinx-book-theme copied to clipboard

Ignore PendingDeprecationWarning about parser_name deprecation with Docutils 0.22

Open mitya57 opened this issue 4 months ago • 1 comments

Otherwise, with the latest Sphinx and Docutils releases (8.2.3 and 0.22.3), the tests fail with:

  File "/home/dmitry/.virtualenvs/sphinx-book-theme/lib/python3.13/site-packages/sphinx/builders/html/__init__.py", line 154, in __init__
    reader: Reader[DocTreeInput] = docutils.readers.doctree.Reader(
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        parser_name='restructuredtext'
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/dmitry/.virtualenvs/sphinx-book-theme/lib/python3.13/site-packages/docutils/readers/__init__.py", line 70, in __init__
    warnings.warn('Argument "parser_name" will be removed '
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  'in Docutils 2.0.\n'
                  ^^^^^^^^^^^^^^^^^^^^
                  '  Specify parser name in the "parser" argument.',
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  PendingDeprecationWarning, stacklevel=2)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PendingDeprecationWarning: Argument "parser_name" will be removed in Docutils 2.0.
  Specify parser name in the "parser" argument.

The bad code is in Sphinx so we have no control over it. It seems to be fixed in sphinx-doc/sphinx@c384ab96c328c3abc91b39c9e3e527863df30af1, but that commit is not a part of any stable release yet.

Downstream Debian bug about failing tests: https://bugs.debian.org/1120185.

mitya57 avatar Nov 09 '25 10:11 mitya57

The CI failure with Python 3.14 that is seen here is unrelated to my changes. pradyunsg/sphinx-theme-builder#51 should fix it.

mitya57 avatar Nov 09 '25 10:11 mitya57

thanks for catching this!

choldgraf avatar Dec 22 '25 17:12 choldgraf