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

Consistent "dictionary changed size during iteration" exception #439

Closed
fmigneault opened this issue Apr 27, 2024 · 2 comments
Closed

Consistent "dictionary changed size during iteration" exception #439

fmigneault opened this issue Apr 27, 2024 · 2 comments
Labels
Needed: Reproduction Case This issue needs a small test case to reproduce the issue before it can be worked on

Comments

@fmigneault
Copy link

fmigneault commented Apr 27, 2024

Error:

Extension error (autoapi.extension):
Handler <function run_autoapi at 0x7f0ec311acb0> for event 'builder-inited' threw an exception (exception: dictionary changed size during iteration)

Relevant branch to test if needed: Ouranosinc/cowbird#53
(can call make docs to run everything)

Full ReadTheDocs log:
https://readthedocs.org/projects/pavics-cowbird/builds/24203224/

 Running Sphinx v7.3.7
/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/autoapi/mappers/python/mapper.py:294: RemovedInSphinx80Warning: The alias 'sphinx.util.status_iterator' is deprecated, use 'sphinx.util.display.status_iterator' instead. Check CHANGES for Sphinx API modifications.
  for dir_root, path in sphinx.util.status_iterator(
[AutoAPI] Reading files... [  2%] /home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/checkouts/53/cowbird/request_task.py
[AutoAPI] Reading files... [  3%] /home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/checkouts/53/cowbird/constants.py
[AutoAPI] Reading files... [  5%] /home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/checkouts/53/cowbird/utils.py

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/sphinx/events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/autoapi/extension.py", line 153, in run_autoapi
    if sphinx_mapper_obj.load(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/autoapi/mappers/python/mapper.py", line 300, in load
    data = self.read_file(path=path, dir_root=dir_root)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/autoapi/mappers/python/mapper.py", line 318, in read_file
    parsed_data = Parser().parse_file(path)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/autoapi/mappers/python/parser.py", line 41, in parse_file
    return self._parse_file(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/autoapi/mappers/python/parser.py", line 37, in _parse_file
    node = astroid.builder.AstroidBuilder().file_build(file_path, module_name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 169, in _post_build
    self.delayed_assattr(delayed)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 240, in delayed_assattr
    for inferred in node.expr.infer():
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 157, in raise_if_nothing_inferred
    yield from generator
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 279, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1758, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 270, in infer_call
    for callee in self.func.infer(context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 358, in infer_attribute
    for owner in self.expr.infer(context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 304, in infer_import
    yield self.do_import_module(self.real_name(name))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
    return mymodule.import_module(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
    return AstroidManager().ast_from_module_name(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/manager.py", line 246, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/manager.py", line 138, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 169, in _post_build
    self.delayed_assattr(delayed)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 240, in delayed_assattr
    for inferred in node.expr.infer():
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 304, in infer_import
    yield self.do_import_module(self.real_name(name))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
    return mymodule.import_module(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
    return AstroidManager().ast_from_module_name(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/manager.py", line 246, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/manager.py", line 138, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 145, in file_build
    return self._post_build(module, builder, encoding)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 169, in _post_build
    self.delayed_assattr(delayed)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 240, in delayed_assattr
    for inferred in node.expr.infer():
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 377, in infer_attribute
    yield from owner.igetattr(self.attrname, context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 274, in igetattr
    yield from _infer_stmts(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 1237, in infer_ifexp
    yield from self.body.infer(context=lhs_context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 431, in infer_subscript
    for value in self.value.infer(context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 358, in infer_attribute
    for owner in self.expr.infer(context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/bases.py", line 177, in _infer_stmts
    for inf in stmt.infer(context=context):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
    yield next(generator)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/decorators.py", line 112, in wrapped
    for res in _func(node, context, **kwargs):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/inference.py", line 304, in infer_import
    yield self.do_import_module(self.real_name(name))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
    return mymodule.import_module(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
    return AstroidManager().ast_from_module_name(
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/manager.py", line 221, in ast_from_module_name
    return self.ast_from_module(named_module, modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/manager.py", line 328, in ast_from_module
    return AstroidBuilder(self).module_build(module, modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/builder.py", line 101, in module_build
    node = self.inspect_build(module, modname=modname, path=path)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/raw_building.py", line 404, in inspect_build
    self.object_build(node, module)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/raw_building.py", line 455, in object_build
    attach_const_node(node, name, member)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/raw_building.py", line 78, in attach_const_node
    _attach_local_node(node, nodes.const_factory(value), name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_classes.py", line 5641, in const_factory
    instance.postinit(_create_dict_items(value, instance))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/astroid/nodes/node_classes.py", line 5612, in _create_dict_items
    for key, value in values.items():
RuntimeError: dictionary changed size during iteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/sphinx/cmd/build.py", line 332, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/sphinx/application.py", line 268, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/sphinx/application.py", line 339, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/pavics-cowbird/envs/53/lib/python3.10/site-packages/sphinx/events.py", line 108, in emit
    raise ExtensionError(
sphinx.errors.ExtensionError: Handler <function run_autoapi at 0x7f0ec311acb0> for event 'builder-inited' threw an exception (exception: dictionary changed size during iteration)

Extension error (autoapi.extension):
Handler <function run_autoapi at 0x7f0ec311acb0> for event 'builder-inited' threw an exception (exception: dictionary changed size during iteration)
@AWhetter AWhetter added the Needed: Reproduction Case This issue needs a small test case to reproduce the issue before it can be worked on label May 20, 2024
@AWhetter
Copy link
Collaborator

I can't reproduce this. Are you able to get the error to show outside of readthedocs?

@fmigneault
Copy link
Author

I rebuilt the failing run since it has been a while and it works now. Whatever broke back then seems to have been resolved since. Will re-open if I encounter the issue again later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: Reproduction Case This issue needs a small test case to reproduce the issue before it can be worked on
Projects
None yet
Development

No branches or pull requests

2 participants