Skip to content

Issue with pydata-sphinx-theme and an empty toctree #253

@sarina

Description

@sarina

Hi,

I found a weird bug where adding this extension to a single page app (index.rst without a toctree), pydata-sphinx-theme threw an error. To work around this, I added dummy.rst files to each app in a hidden toctree, which seems silly but did work.

I believe the problem comes from this code: https://github.com/readthedocs/sphinx-notfound-page/blob/main/notfound/extension.py#L147-L148 - we return None if there's no toctree here, but when pydata-sphinx-theme tries to consume this, it fails on https://github.com/pydata/pydata-sphinx-theme/blob/fc54589ae964055ea32a9d407fcc812cd77887a8/src/pydata_sphinx_theme/toctree.py#L367 because we've passed it a None object.

I don't know the best way to fix this - should I PR to pydata-sphinx-theme to throw a reasonable error there if they get a None object? Should we do something in this extension? Any advice is great, I'm happy to make a PR to fix.

Ref: openedx-unsupported/edx-documentation#2332

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions