Open
Description
Describe the bug
When the same sections are found in multiple files (like e.g. in https://gitlab.com/qemu-project/qemu/-/issues/2190), it is not deterministic which reference gets included into objects.inv
.
How to Reproduce
Unfortunately I've not been able to trigger this problem in a minimal example yet. In theory it should be nondeterministic with an empty conf.py
, and:
index.rst:
.. include:: toinclude.rst.inc
index.rst:
.. include:: toinclude.rst.inc
toinclude.rst.inc
foo
---
bar
... but I haven't seen it produce different objects.inv indexes with this minimal example, so there might be more going on.
Environment Information
Platform: linux; (Linux-6.7.4-x86_64-with-glibc2.38)
Python version: 3.11.7 (main, Dec 4 2023, 18:10:11) [GCC 13.2.0])
Python implementation: CPython
Sphinx version: 7.2.6
Docutils version: 0.20.1
Jinja2 version: 3.1.3
Pygments version: 2.17.2
Sphinx extensions
No response
Additional context
https://github.com/sphinx-doc/sphinx/blob/bc74a6223caa72c39b8ccad3f17202dcb098c918/sphinx/domains/python.py#L1546C23-L1553 might be relevant