Skip to content

sphinx 9.0.4 breaks build of khard 0.20.0 #14206

@0-wiz-0

Description

@0-wiz-0

Describe the bug

In pkgsrc, we've updated sphinx from 8.2.3 to 9.0.4. After that change, khard 0.20.0 does not build any longer (the latest release, from https://github.com/lucc/khard/ ).

The output from building khard ends with:

Running Sphinx v9.0.4
loading translations [en]... done
making output directory... done
Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`.
[AutoAPI] Reading files... [100%] /scratch/misc/khard/work/khard-0.20.0/khard/helpers/typing.py
[AutoAPI] Mapping Data... [100%] /scratch/misc/khard/work/khard-0.20.0/khard/helpers/typing.py
[AutoAPI] Rendering Data... [  7%] khard
[AutoAPI] Rendering Data... [ 13%] khard.cli
[AutoAPI] Rendering Data... [ 20%] khard.khard
[AutoAPI] Rendering Data... [ 27%] khard.query
[AutoAPI] Rendering Data... [ 33%] khard.config
[AutoAPI] Rendering Data... [ 40%] khard.actions
[AutoAPI] Rendering Data... [ 47%] khard.version
[AutoAPI] Rendering Data... [ 53%] khard.helpers
[AutoAPI] Rendering Data... [ 60%] khard.contacts
[AutoAPI] Rendering Data... [ 67%] khard.__main__
[AutoAPI] Rendering Data... [ 73%] khard.formatter
[AutoAPI] Rendering Data... [ 80%] khard.exceptions
[AutoAPI] Rendering Data... [ 87%] khard.address_book
[AutoAPI] Rendering Data... [ 93%] khard.helpers.typing
[AutoAPI] Rendering Data... [100%] khard.helpers.interactive

[autosummary] generating autosummary for: bench.rst, commandline.rst, contributing.rst, davcontroller.rst, index.rst, indices.rst, man.rst, man/khard-subcommands.rst, man/khard.conf.rst, man/khard.rst, scripting.rst

building [mo]: targets for 0 po files that are out of date
writing output...
building [man]: all manpages
updating environment: [new config] 27 added, 0 changed, 0 removed
[AutoAPI] Adding AutoAPI TOCTree [autoapi/index] to index.rst
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/address_book/index.rst:21: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/actions/index.r
st [autosectionlabel.autoapi/khard/address_book/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/address_book/index.rst:31: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/actions
/index.rst [autosectionlabel.autoapi/khard/address_book/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst:13: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/address_book/index.rs
t [autosectionlabel.autoapi/khard/cli/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst:21: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/address_book/index.rst [
autosectionlabel.autoapi/khard/cli/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst:41: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/address_book/ind
ex.rst [autosectionlabel.autoapi/khard/cli/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst:13: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst [aut
osectionlabel.autoapi/khard/config/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst:22: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst [autose
ctionlabel.autoapi/khard/config/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst:30: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst [auto
sectionlabel.autoapi/khard/config/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst:40: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/cli/index.rst
 [autosectionlabel.autoapi/khard/config/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rst:23: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst
 [autosectionlabel.autoapi/khard/contacts/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rst:33: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst [a
utosectionlabel.autoapi/khard/contacts/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rst:43: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/index.rst
[autosectionlabel.autoapi/khard/contacts/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rst:52: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/config/inde
x.rst [autosectionlabel.autoapi/khard/contacts/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/exceptions/index.rst:24: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/
index.rst [autosectionlabel.autoapi/khard/exceptions/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/formatter/index.rst:13: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rst
 [autosectionlabel.autoapi/khard/formatter/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/formatter/index.rst:21: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/exceptions
/index.rst [autosectionlabel.autoapi/khard/formatter/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/index.rst:23: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rs
t [autosectionlabel.autoapi/khard/helpers/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/index.rst:32: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/contacts/index.rst
 [autosectionlabel.autoapi/khard/helpers/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/interactive/index.rst:13: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpe
rs/index.rst [autosectionlabel.autoapi/khard/helpers/interactive/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/interactive/index.rst:21: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/formatte
r/index.rst [autosectionlabel.autoapi/khard/helpers/interactive/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/interactive/index.rst:30: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helper
s/index.rst [autosectionlabel.autoapi/khard/helpers/interactive/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/interactive/index.rst:40: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/
formatter/index.rst [autosectionlabel.autoapi/khard/helpers/interactive/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/interactive/index.rst:40: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/sou23:12:45 [48/1938]
formatter/index.rst [autosectionlabel.autoapi/khard/helpers/interactive/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/typing/index.rst:13: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/in
teractive/index.rst [autosectionlabel.autoapi/khard/helpers/typing/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/typing/index.rst:23: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/int
eractive/index.rst [autosectionlabel.autoapi/khard/helpers/typing/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/typing/index.rst:34: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpe
rs/interactive/index.rst [autosectionlabel.autoapi/khard/helpers/typing/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/index.rst:8: WARNING: duplicate label submodules, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/index.rst [autosec
tionlabel.autoapi/khard/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/khard/index.rst:13: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/typing/inde
x.rst [autosectionlabel.autoapi/khard/khard/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/khard/index.rst:23: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/typing/index
.rst [autosectionlabel.autoapi/khard/khard/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/khard/index.rst:59: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/typing
/index.rst [autosectionlabel.autoapi/khard/khard/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/query/index.rst:13: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/khard/index.rst [au
tosectionlabel.autoapi/khard/query/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/query/index.rst:21: WARNING: duplicate label classes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/helpers/interactive/in
dex.rst [autosectionlabel.autoapi/khard/query/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/query/index.rst:37: WARNING: duplicate label functions, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/khard/index.rst [aut
osectionlabel.autoapi/khard/query/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/query/index.rst:45: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/khard/index.rs
t [autosectionlabel.autoapi/khard/query/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/version/index.rst:8: WARNING: duplicate label attributes, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/query/index.rst [a
utosectionlabel.autoapi/khard/version/index]
/scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/version/index.rst:21: WARNING: duplicate label module contents, other instance in /scratch/misc/khard/work/khard-0.20.0/doc/source/autoapi/khard/query/index.
rst [autosectionlabel.autoapi/khard/version/index]


Versions
========

* Platform:         netbsd11; (NetBSD-11.99.4-amd64-x86_64-64bit-ELF)
* Python version:   3.14.2 (CPython)
* Sphinx version:   9.0.4
* Docutils version: 0.22.4
* Jinja2 version:   3.1.6
* Pygments version: 2.19.2

Last Messages
=============

    indices


    reading sources... [ 85%]
    man

    reading sources... [ 89%]
    man/khard

Loaded Extensions
=================

* sphinx.ext.mathjax (9.0.4)
* alabaster (1.0.0)
* sphinxcontrib.applehelp (2.0.0)
* sphinxcontrib.devhelp (2.0.0)
* sphinxcontrib.htmlhelp (2.1.0)
* sphinxcontrib.serializinghtml (2.0.0)
* sphinxcontrib.qthelp (2.0.0)
* sphinx.ext.autodoc (9.0.4)
* sphinx.ext.autosummary (9.0.4)
* sphinx.ext.graphviz (9.0.4)
* sphinx.ext.inheritance_diagram (9.0.4)
* autoapi.extension (unknown version)
* sphinx.ext.autosectionlabel (9.0.4)
* sphinx.ext.todo (9.0.4)
* sphinx_autodoc_typehints (unknown version)
* sphinxarg.ext (0.5.2)

Traceback
=========

      File "/usr/pkg/lib/python3.14/site-packages/sphinxarg/ext.py", line 511, in run
        with mock(self.config.autodoc_mock_imports):
             ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: 'module' object is not callable


The full traceback has been saved in:
/tmp/sphinx-err-4qidm1pf.log

To report this error to the developers, please open an issue at <https://github.com/sphinx-doc/sphinx/issues/>. Thanks!
Please also report this if it was a user error, so that a better error message can be provided next time.

In the referenced log in /tmp I see:

Traceback
=========

    Traceback (most recent call last):
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/cmd/build.py", line 432, in build_main
        app.build(args.force_all, args.filenames)
        ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/application.py", line 442, in build
        self.builder.build_update()
        ~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/builders/__init__.py", line 377, in build_update
        self.build(['__all__'], summary=to_build, method='update')
        ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/builders/__init__.py", line 408, in build
        updated_docnames = set(self.read())
                               ~~~~~~~~~^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/builders/__init__.py", line 524, in read
        self._read_serial(docnames)
        ~~~~~~~~~~~~~~~~~^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/builders/__init__.py", line 589, in _read_serial
        self.read_doc(docname)
        ~~~~~~~~~~~~~^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/builders/__init__.py", line 652, in read_doc
        doctree = _parse_str_to_doctree(
            content,
        ...<6 lines>...
            transforms=self._registry.get_transforms(),
        )
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/util/docutils.py", line 890, in _parse_str_to_doctree
        parser.parse(content, document)
        ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/sphinx/parsers.py", line 99, in parse
        self.statemachine.run(inputlines, document, inliner=self.inliner)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/docutils/parsers/rst/states.py", line 182, in run
        results = StateMachineWS.run(self, input_lines, input_offset,
                                     input_source=document['source'])
      File "/usr/pkg/lib/python3.14/site-packages/docutils/statemachine.py", line 234, in run
        context, next_state, result = self.check_line(
                                      ~~~~~~~~~~~~~~~^
            context, state, transitions)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/docutils/statemachine.py", line 446, in check_line
        return method(match, context, next_state)
      File "/usr/pkg/lib/python3.14/site-packages/docutils/parsers/rst/states.py", line 2487, in explicit_markup
        nodelist, blank_finish = self.explicit_construct(match)
                                 ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/docutils/parsers/rst/states.py", line 2499, in explicit_construct
        return method(self, expmatch)
      File "/usr/pkg/lib/python3.14/site-packages/docutils/parsers/rst/states.py", line 2236, in directive
        return self.run_directive(
               ~~~~~~~~~~~~~~~~~~^
            directive_class, match, type_name, option_presets)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/pkg/lib/python3.14/site-packages/docutils/parsers/rst/states.py", line 2286, in run_directive
        result = directive_instance.run()
      File "/usr/pkg/lib/python3.14/site-packages/sphinxarg/ext.py", line 511, in run
        with mock(self.config.autodoc_mock_imports):
             ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: 'module' object is not callable

Let me know if you need further information.

Is this related to #14089 ?

How to Reproduce

In pkgsrc, we download and install the dependencies from pkgsrc, the build of khard is then run with

/usr/pkg/bin/python3.14  -m build --wheel --skip-dependency-check --no-isolation

Let me know if you need more details.

Environment Information

Platform:              netbsd11; (NetBSD-11.99.4-amd64-x86_64-64bit-ELF)
Python version:        3.14.2 (main, Dec 19 2025, 08:35:31) [GCC 14.3.0])
Python implementation: CPython
Sphinx version:        9.0.4
Docutils version:      0.22.4
Jinja2 version:        3.1.6
Pygments version:      2.19.2

Sphinx extensions

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions