sphinx-autodoc-typehints icon indicating copy to clipboard operation
sphinx-autodoc-typehints copied to clipboard

Return type + docstring `container` directive generates error

Open trevorbaca opened this issue 10 months ago • 0 comments

sphinx-autodoc-typehints generates an error and a warning when processing this function:

def foo() -> int:
    """
    Description.

    ..  container::

        More description.

    """
    return
/path/to/file:5: ERROR: Content block expected for the "container" directive; none found. [docutils]
/path/to/file:6: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]

The bug is triggered when these two things are true:

  • the function annotates a return type
  • the function's docstring contains a container directive

This is with sphinx-autodoc-typehints 2.5.0, but I think a version of this bug (always triggered by a container directive) has been around since at least February 2023.

trevorbaca avatar Jan 02 '25 01:01 trevorbaca