Skip to content

Sphinx v7.3.7: AttributeError: 'Symbol' object has no attribute '_children' #12580

@sphuber

Description

@sphuber

Describe the bug

The example Python source file (see in how to reproduce) excepts when compiled with Sphinx 7.3.7. Any other older version works just fine. It excepts with the following error:

Exception occurred:
  File "/home/sph/.mambaforge/envs/aiida-py311/lib/python3.11/site-packages/sphinx/domains/c/_symbol.py", line 179, in get_all_symbols
    for sChild in self._children:
                  ^^^^^^^^^^^^^^                                                                                                                                                                                 AttributeError: 'Symbol' object has no attribute '_children'

How to Reproduce

conf.py

import os
import sys
sys.path.insert(0, os.path.abspath('../src'))

extensions = ['sphinx.ext.autodoc']

index.rst

.. automodule:: thing
   :members:
import typing as t

P = t.ParamSpec('P')
R_co = t.TypeVar('R_co', covariant=True)
N = t.TypeVar('N', bound=str)


class ProcessFunctionType(t.Protocol, t.Generic[P, R_co, N]):
    """Protocol type."""

    def run(self, *args: P.args, **kwargs: P.kwargs) -> R_co:
        """Some method."""

build it Sphinx v7.3.7

Environment Information

sphinx==7.3.7

Sphinx extensions

sphinx.ext.autodoc

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions