Sphinx: [2.4.0] TypeError: 'getset_descriptor' object is not iterable

Created on 10 Feb 2020  路  7Comments  路  Source: sphinx-doc/sphinx

Describe the bug
After update sphinx to 2.4.0 version I got error:

$ sphinx-build docs -j auto -W --keep-going public/
...
waiting for workers...
Sphinx parallel build error:
TypeError: 'getset_descriptor' object is not iterable

Or

$ sphinx-build docs -j 1 -W --keep-going public/
...
Exception occurred:
  File "/home/_/.tox/docs/lib/python3.7/site-packages/sphinx/ext/autodoc/importer.py", line 168, in get_object_members
    for name in subject.__annotations__:
TypeError: 'getset_descriptor' object is not iterable

Environment info

  • OS: linux
  • Python version: 3.7.0
  • Sphinx version: 2.4.0
  • Sphinx extensions:

    • sphinx-autodoc-typehints==1.10.3

    • sphinxcontrib-applehelp==1.0.1

    • sphinxcontrib-devhelp==1.0.1

    • sphinxcontrib-htmlhelp==1.0.2

    • sphinxcontrib-jsmath==1.0.1

    • sphinxcontrib-qthelp==1.0.2

    • sphinxcontrib-serializinghtml==1.1.3

autodoc bug

Most helpful comment

Fixed. Thank you for reporting.

All 7 comments

Hmm... that's strange. I don't know why the object returns non list items as __annotations__ member. I think it is broken. Could you check what kind of object causes this error in verbose mode(-v)?

I'm also running into this issue on sphinx 2.4.0. Here is the log.

@kne42 Thank you for info! I confirmed the error on my local.

FROM python:3.8-slim

RUN apt update; apt install -y git make build-essential qt5-default
RUN git clone https://github.com/napari/napari.git
WORKDIR /napari
RUN pip3 install -e .
RUN pip3 install sphinx_rtd_theme
WORKDIR /napari/docs
RUN make html SPHINXOPTS=-vv

It seems this comes from wrapt.ObjectProxy. Anyway it would be better to handle such error on Sphinx side!

I just made a PR #7130 to fix this. Could you try this please if you have time. It seems working fine on my loal!

I'll release it in this night (in JST).

Fixed. Thank you for reporting.

Hi, I'm getting this error message on Sphinx 3.1.0. I wonder if it's the same problem, uncaught in another part of Sphinx.

sphinx-build -b html source build -P
...
Exception occurred:
File "/home/aaron/.pyenv/versions/3.7.7/envs/triage_dev/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1900, in add_directive_header
if annotations and self.objpath[-1] in annotations:
TypeError: argument of type 'getset_descriptor' is not iterable

Without a deep understanding of Sphinx it's hard for me to tell what's going on here. But the offending annotations in my case isn't of type Mapping (as checked for in #7130). And when I added and isinstance(annotations, Mapping) to that if statement, that allowed my build to run to completion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shimizukawa picture shimizukawa  路  3Comments

jfbu picture jfbu  路  3Comments

ubershmekel picture ubershmekel  路  3Comments

scolby33 picture scolby33  路  3Comments

Paebbels picture Paebbels  路  3Comments