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

RuntimeError: dictionary changed size during iteration #1342

Closed
return42 opened this issue Jun 17, 2022 · 0 comments · Fixed by #1344
Closed

RuntimeError: dictionary changed size during iteration #1342

return42 opened this issue Jun 17, 2022 · 0 comments · Fixed by #1344
Labels
bug Something isn't working

Comments

@return42
Copy link
Member

return42 commented Jun 17, 2022

Really rare but from time to time we have a

RuntimeError: dictionary changed size during iteration

in the CI [1]. The full traceback is shown below. The issue appears while building the documentation make docs.

First reported by @dalf [2] in March 2022, but I have been seeing this error for a bit longer [3]

[1] https://github.com/searxng/searxng/runs/6931810805?check_suite_focus=true#step:6:624
[2] #930 (comment)
[3] #930 (comment)

Traceback (most recent call last):
  File "/home/runner/work/searxng/searxng/local/py3/lib/python3.9/site-packages/sphinx/config.py", line 332, in eval_config_file
    exec(code, namespace)
  File "/home/runner/work/searxng/searxng/docs/conf.py", line 49, in <module>
    searx.engines.load_engines(searx.settings['engines'])
  File "/home/runner/work/searxng/searxng/searx/engines/__init__.py", line 292, in load_engines
    engine = load_engine(engine_data)
  File "/home/runner/work/searxng/searxng/searx/engines/__init__.py", line 139, in load_engine
    set_loggers(engine, engine_name)
  File "/home/runner/work/searxng/searxng/searx/engines/__init__.py", line 152, in set_loggers
    for module_name, module in sys.modules.items():
RuntimeError: dictionary changed size during iteration
@return42 return42 added the bug Something isn't working label Jun 17, 2022
dalf added a commit to dalf/searxng that referenced this issue Jun 18, 2022
use sys.modules.copy() to avoid "RuntimeError: dictionary changed size during iteration"
see python/cpython#89516
and https://docs.python.org/3.10/library/sys.html#sys.modules

close searxng#1342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

1 participant