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: name 'status_iterator' is not defined #13438

Closed
TriangleBear opened this issue Mar 18, 2025 · 4 comments
Closed

Exception: name 'status_iterator' is not defined #13438

TriangleBear opened this issue Mar 18, 2025 · 4 comments
Labels
extensions:third party Relating to third-party extensions type:bug

Comments

@TriangleBear
Copy link

TriangleBear commented Mar 18, 2025

Describe the bug

I was supposed to use the extension called sphinxcontrib-images, then I checked how to further fix it. I searched that installing setuptools from pip helps but when I installed and run the sphinx build it got another error which hit me blanked, because I don't know why it is.

How to Reproduce

Installing the sphinxcontrib-images and setuptools in pip
apply the extension to conf.py

extensions = [
    ... 
    'sphinxcontrib.images',
    ...
]

Environment Information

Versions
========

* Platform:         win32; (Windows-11-10.0.26100-SP0)
* Python version:   3.13.2 (CPython)
* Sphinx version:   8.2.3
* Docutils version: 0.21.2
* Jinja2 version:   3.1.6
* Pygments version: 2.19.1

Last Messages
=============



    reading sources... [ 86%]
    content/report/index


    reading sources... [100%]
    index

Loaded Extensions
=================

* sphinx.ext.mathjax (8.2.3)
* alabaster (0.7.16)
* sphinxcontrib.applehelp (2.0.0)
* sphinxcontrib.devhelp (2.0.0)
* sphinxcontrib.htmlhelp (2.1.0)
* sphinxcontrib.serializinghtml (2.0.0)
* sphinxcontrib.qthelp (2.0.0)
* myst_parser (4.0.1)
* sphinxcontrib.images (8.2.3)
* sphinx_book_theme (unknown version)
* pydata_sphinx_theme (unknown version)

Traceback
=========

    Traceback (most recent call last):
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\events.py", line 404, in emit
        results.append(listener.handler(self.app, *args))
                       ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinxcontrib\images.py", line 246, in download_images
        if hasattr(app.builder, 'status_iterator') else status_iterator)(
                                                        ^^^^^^^^^^^^^^^
    NameError: name 'status_iterator' is not defined
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\cmd\build.py", line 432, in build_main
        app.build(args.force_all, args.filenames)
        ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\application.py", line 426, in build
        self.builder.build_update()
        ~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\builders\__init__.py", line 375, in build_update
        self.build(
        ~~~~~~~~~~^
            to_build,
            ^^^^^^^^^
        ...<2 lines>...
            method='update',
            ^^^^^^^^^^^^^^^^
        )
        ^
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\builders\__init__.py", line 403, in build
        updated_docnames = set(self.read())
                               ~~~~~~~~~^^
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\builders\__init__.py", line 564, in read
        for retval in self.events.emit('env-updated', self.env):
                      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\...\AppData\Local\Programs\Python\Python313\Lib\site-packages\sphinx\events.py", line 415, in emit
        raise ExtensionError(
        ...<4 lines>...
        ) from exc
    sphinx.errors.ExtensionError: Handler <function download_images at 0x000001A5B3965300> for event 'env-updated' threw an exception (exception: name 'status_iterator' is not defined)

Sphinx extensions

extensions = [
    'myst_parser', 
    'sphinxcontrib.images'
]

Additional context

No response

@AA-Turner
Copy link
Member

This is a failure in a third-party extension.

A

@AA-Turner AA-Turner closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2025
@AA-Turner AA-Turner added the extensions:third party Relating to third-party extensions label Mar 18, 2025
@gvaalta
Copy link

gvaalta commented Mar 20, 2025

My project was working fine and I suddenly got the exact same error. Any idea what could have happened ?

@AA-Turner
Copy link
Member

@gvaalta please open a new issue. We need to know what has changed (clearly something did for your project to break).

A

@sphinx-doc sphinx-doc locked and limited conversation to collaborators Mar 20, 2025
@mgeier
Copy link
Contributor

mgeier commented Mar 22, 2025

This might be related to cc8161a (see also #13352).

A fix seems to be already available since more than a year, but it hasn't yet been merged: sphinx-contrib/images#39

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:third party Relating to third-party extensions type:bug
Projects
None yet
Development

No branches or pull requests

4 participants