Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception/crash when validating doc-string with \-line-break in summary #457

Open
oscargus opened this issue May 18, 2023 · 1 comment
Open

Comments

@oscargus
Copy link

def foo():
    """
    Quite long line, e.g., because I link to\
something and do not want to upset\
line length rules and keep this\
a single sentence.
    """

(Enough to have a single \, but for motivation.)

Leads to, when checking:

Handler <function mangle_docstrings at 0x000002E31CBBC550> for event 'autodoc-process-docstring' threw an exception (exception: unexpected indent (<unknown>, line 1))

Version: 1.5.0

(I guess the reason I started using \ is that some other checker, (velin?), allows this.)

@oscargus oscargus changed the title Exception/crash when checking doc-string with \-line-break in first sentence. Exception/crash when checking doc-string with \-line-break in summary May 18, 2023
@oscargus oscargus changed the title Exception/crash when checking doc-string with \-line-break in summary Exception/crash when validating doc-string with \-line-break in summary May 18, 2023
@rossbar
Copy link
Contributor

rossbar commented May 18, 2023

I'm not sure this is a numpydoc problem, at least not on its own. The parsing/conversion to the docstring object seems to handle this case okay:

>>> from numpydoc.docscrape_sphinx import SphinxFunctionDoc
>>> def foo():
...:     """A really long docstring summary \
...: https://numpydoc.readthedocs.io/en/latest/format.html#short-summary
...: 
...:     See Also
...:     --------
...:     bar
...:     """
>>> sds = SphinxFunctionDoc(foo)  # No exception here
>>> print(sds)
A really long docstring summary https://numpydoc.readthedocs.io/en/latest/format.html#short-summary










.. seealso::

    
    :obj:`bar`
        ..

It be good to confirm that this problem doesn't originate from autodoc or sphinx itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants