Skip to content

Incorrect objects.inv produced for singlehtml #10106

Open

Description

@Kodiologist

Describe the bug

I haven't been able to get Intersphinx links to objects in Hyrule to work. I think this is because Hyrule uses the singlehtml builder and the generated objects.inv in this case has spurious anchors.

How to Reproduce

#!/bin/sh
mkdir testp
cd testp
mkdir mylib
printf 'def foo():\n "my docstring"\n return 1\n' >mylib/__init__.py
printf '.. automodule:: mylib\n  :members:\n' >index.rst
echo 'extensions = ["sphinx.ext.autodoc"]' >conf.py
mkdir build
PYTHONPATH=. sphinx-build . _build -b singlehtml
python3 -msphinx.ext.intersphinx _build/objects.inv

Expected behavior

I expected index.html#module-mylib in the output, as with the html builder, instead of index.html#document-index#module-mylib.

Your project

See the shell script above.

Screenshots

No response

OS

Ubuntu 21.10

Python version

3.9.7

Sphinx version

4.3.2

Sphinx extensions

sphinx.ext.autodoc

Extra tools

No response

Additional context

No response

Activity

  1. added a commit that references this issue on Jan 18, 2022
  2. added this to the some future version milestone on Sep 29, 2022
  3. jdillard commented on Sep 30, 2025

    @jdillard
    SponsorMember

    I don't know if things have changed in more recent versions, but index.html doesn't appear included in the objects file anymore, making it break intersphinx links where the webserver doesn't redirect for a missing index.html in the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions