Skip to content

Build broken due to TypeError: 'generator' object is not subscriptable #9788

Closed

Description

@m4sterbunny

Describe the bug

This built fine locally for me.

When I tried to force a build from your interface this Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/lib/python3.7/site-packages/sphinx/builders/latex/init.py", line 201, in write
if toctrees[0].get('maxdepth') > 0:
TypeError: 'generator' object is not subscriptable

How to Reproduce

git clone --no-single-branch --depth 50 https://github.com/m4sterbunny/Demo.git .
git checkout --force origin/master
git clean -d -f -f
python3.7 -mvirtualenv /home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest
/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/bin/python -m pip install --upgrade --no-cache-dir pip setuptools
/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/bin/python -m pip install --upgrade --no-cache-dir mock==1.0.1 pillow==5.4.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.8.1 recommonmark==0.5.0 sphinx<2 sphinx-rtd-theme<0.5 readthedocs-sphinx-ext<2.2
cat source/conf.py
/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/bin/python -m sphinx -T -b html -d _build/doctrees -D language=en . _build/html
/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/bin/python -m sphinx -T -b readthedocssinglehtmllocalmedia -d _build/doctrees -D language=en . _build/localmedia
/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/bin/python -m sphinx -b latex -D language=en -d _build/doctrees . _build/latex
Running Sphinx v1.8.5
loading translations [en]... done
making output directory...
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing Showcasing.tex...
Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/envs/latest/lib/python3.7/site-packages/sphinx/builders/latex/init.py", line 201, in write
if toctrees[0].get('maxdepth') > 0:
TypeError: 'generator' object is not subscriptable
The full traceback has been saved in /tmp/sphinx-err-omlwgho4.log,

Expected behavior

This built fine locally. I expected you to build it too!
Outputs here: https://demo-zoom.readthedocs.io/en/latest/pages/

Your project

https://readthedocs.org/projects/demo-zoom

Screenshots

No response

OS

Win 10 with Ubuntu

Python version

Python 3

Sphinx version

How do I even get that Sphinx -v does not work, nor variants of

Sphinx extensions

No response

Extra tools

No response

Additional context

Works for me locally. What's up?

Activity

  1. astrojuanlu commented on Oct 28, 2021

    @astrojuanlu
    Contributor

    Similar to #9727, pin docutils<0.18 in your requirements.

  2. astrojuanlu commented on Oct 28, 2021

    @astrojuanlu
    Contributor
  3. m4sterbunny commented on Oct 28, 2021

    @m4sterbunny
    Author

    Tried to follow the docs, but despite specifying which Sphinx -- locally and remotely I seem to be on 1.8.5:
    image

  4. astrojuanlu commented on Oct 28, 2021

    @astrojuanlu
    Contributor

    The .readthedocs.yaml file should be at the root of the repository, please try moving it

  5. peterjc commented on Oct 28, 2021

    @peterjc
    Contributor

    Just noticed this started 2 or 3 days ago for me on RTD:
    https://readthedocs.org/projects/thapbi-pict/builds/

    Exception occurred:
      File "/home/docs/checkouts/readthedocs.org/user_builds/thapbi-pict/envs/latest/lib/python3.7/site-packages/sphinx/builders/latex/__init__.py", line 201, in write
        if toctrees[0].get('maxdepth') > 0:
    TypeError: 'generator' object is not subscriptable
    

    Good:
    Jinja2-3.0.2 MarkupSafe-2.0.1 Pygments-2.10.0 alabaster-0.7.12 babel-2.9.1 certifi-2021.10.8 charset-normalizer-2.0.7 commonmark-0.8.1 docutils-0.17.1 future-0.18.2 idna-3.3 imagesize-1.2.0 mock-1.0.1 packaging-21.0 pillow-5.4.1 pyparsing-3.0.1 pytz-2021.3 readthedocs-sphinx-ext-2.1.4 recommonmark-0.5.0 requests-2.26.0 six-1.16.0 snowballstemmer-2.1.0 sphinx-1.8.5 sphinx-rtd-theme-0.4.3 sphinxcontrib-serializinghtml-1.1.5 sphinxcontrib-websupport-1.2.4 urllib3-1.26.7

    Bad:
    Jinja2-3.0.2 MarkupSafe-2.0.1 Pygments-2.10.0 alabaster-0.7.12 babel-2.9.1 certifi-2021.10.8 charset-normalizer-2.0.7 commonmark-0.8.1 docutils-0.18 future-0.18.2 idna-3.3 imagesize-1.2.0 mock-1.0.1 packaging-21.0 pillow-5.4.1 pyparsing-3.0.3 pytz-2021.3 readthedocs-sphinx-ext-2.1.4 recommonmark-0.5.0 requests-2.26.0 six-1.16.0 snowballstemmer-2.1.0 sphinx-1.8.5 sphinx-rtd-theme-0.4.3 sphinxcontrib-serializinghtml-1.1.5 sphinxcontrib-websupport-1.2.4 urllib3-1.26.7

    i.e. Updated from docutils-0.17.1 (working) to docutils-0.18 (broken)

  6. m4sterbunny commented on Oct 29, 2021

    @m4sterbunny
    Author

    I had tried that in my wanderings in the wilderness; but to no effect:

    image

  7. astrojuanlu commented on Oct 29, 2021

    @astrojuanlu
    Contributor

    @m4sterbunny You didn't move your .readthedocs.yaml file yet, or at least I don't see it in your demo project. If you do, please link to the corresponding build or commit.

    @peterjc Yes, this is caused by docutils 0.18, see the linked issues in my comments above.

  8. m4sterbunny commented on Oct 29, 2021

    @m4sterbunny
    Author

    OK -- so I pushed rather than just looking local. Interestingly I am now getting different Sphinx version locally compared to your Build:
    image

  9. m4sterbunny commented on Oct 29, 2021

    @m4sterbunny
    Author

    But the RtD build fails with a new error (whereas local build completes):
    [https://readthedocs.org/projects/demo-zoom/builds/15124864/]

    Sphinx error:
    master file /home/docs/checkouts/readthedocs.org/user_builds/demo-zoom/checkouts/latest/index.rst not found

  10. astrojuanlu commented on Oct 29, 2021

    @astrojuanlu
    Contributor

    @m4sterbunny The .readthedocs.yaml file is only used by Read the Docs, it has no effect locally.

    I see that the generator problem was solved after moving the config file to the root of the repository. Please open another issue with the current problem.

  11. 1 remaining item

  12. added a commit that references this issue on Oct 31, 2021
  13. added a commit that references this issue on Nov 1, 2021
  14. added a commit that references this issue on Nov 2, 2021
  15. added a commit that references this issue on Nov 17, 2021
  16. locked as resolved and limited conversation to collaborators on Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions