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

1.19.3: _get_sphinx_line_keyword_and_argument: IndexError: list index out of range #259

Closed
ewjoachim opened this issue Sep 27, 2022 · 6 comments · Fixed by #261
Closed

Comments

@ewjoachim
Copy link

ewjoachim commented Sep 27, 2022

Hello,

My CI just broke after building with the new 1.19.3. I haven't investigated yet, but it breaks inside sphinx-autodoc-typehints hours after a new release, so that seems highly suspicious :) I'll investigate at some point, but in the meantime, if the following error log and project help you find and squash the bug, I'll be happy to leave you to it :)

Project: procrastinate-org/procrastinate#684
CI Failure: https://readthedocs.org/projects/procrastinate/builds/18176516/

@ascillitoe
Copy link

We are also experiencing the same failure in our CI:

https://github.com/SeldonIO/alibi-detect/actions/runs/3132027851/jobs/5088241046

@haiiliin
Copy link

haiiliin commented Sep 27, 2022

I also encountered this problem:

https://github.com/haiiliin/abqpy/actions/runs/3132489988/jobs/5084889072

@damiengermonville
Copy link

Hi,

Same here, quickly investigated to find that (in my case) the .. code-block:: sections are involved :

In [1]: from sphinx_autodoc_typehints import _get_sphinx_line_keyword_and_argument

In [2]: _get_sphinx_line_keyword_and_argument(".. code-block:: python")
param_line_without_description ['.. code-block', '', ' python']
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-2-eed0d838ba14> in <module>
----> 1 _get_sphinx_line_keyword_and_argument(".. code-block:: python")

[REDACTED]/venv/lib/python3.9/site-packages/sphinx_autodoc_typehints/__init__.py in _get_sphinx_line_keyword_and_argument(line)
    529     print("param_line_without_description", param_line_without_description)  # added debug print
    530     if len(split_directive_and_name) != 2:
--> 531         return (split_directive_and_name[0], None)
    532 
    533     return tuple(split_directive_and_name)  # type: ignore

IndexError: list index out of range

Mitigation : downgraded to sphinx-autodoc-typehints==1.19.2 fixed the issue (for me).

@gaborbernat
Copy link
Member

Seems this was introduced by @Numerlor in #254

@ewjoachim
Copy link
Author

Haha, that was fast <3 I see 1.19.4 is out too !

You're awesome, thank you !

@ewjoachim
Copy link
Author

(I've sponsored you a coffee/beer/beverage of your choice)

ascillitoe added a commit to SeldonIO/alibi-detect that referenced this issue Jan 6, 2023
Remove the comment about limiting `sphinx-autodoc-typehints` upper-bound now that tox-dev/sphinx-autodoc-typehints#259 is fixed.
ascillitoe added a commit to SeldonIO/alibi that referenced this issue Jan 6, 2023
Remove the comment about limiting `sphinx-autodoc-typehints` upper-bound now that tox-dev/sphinx-autodoc-typehints#259 is fixed.
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

Successfully merging a pull request may close this issue.

5 participants