labscript-suite-oldfinal1 / labscript_utils

Shared modules used by the labscript suite. Includes a graphical exception handler, debug tools, configuration management, cross platform filepath conversions, unit conversions and custom GUI widgets.
Other
0 stars 0 forks source link

RuntimeError: dictionary changed size during iteration #17

Closed philipstarkey closed 6 years ago

philipstarkey commented 6 years ago

Original report (archived issue) by fretchen (Bitbucket: fretchen).


If I run labscript_utils in python3 this error is raised.


labscript_utils/double_import_denier.py", line 67, in __init__
    for name, module in sys.modules.items():
RuntimeError: dictionary changed size during iteration

It would seem that this is a known issue

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Thanks for the report! That's strange. Easily fixed, but I can't guess why sys.modules would be modified during that loop. That would imply something's being imported mid-loop. Perhaps an import in another thread. Anyway, will fix.

philipstarkey commented 6 years ago

Original comment by fretchen (Bitbucket: fretchen).


Hi Chris,

the error is raise within the following context:

#!python

from app import app
from app.forms import LoginForm, FileForm
from flask import render_template, flash, redirect
import labscript_utils

from lyse import *

One should also know that I did not go through the full installer as I want to have some flexibility on where I install lyse etc later-on. In the meantime, I found that running this many times the error disappears. So the bug still remains, but I have a hard time understanding it.

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Must be additional threads in flask or something else.

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Should be fixed by pull request #44

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Merged in cbillington/labscript_utils/bugfix (pull request #44)

Fix issue #17

→ \<\<cset a5c2833a6b098bd906b77408f2fde10395fb9a69>>

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Fix issue #17

→ \<\<cset 11cf5482f69bff150f95d80d67d7f58dd3965b47>>

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Merged in cbillington/labscript_utils/bugfix (pull request #44)

Fix issue #17

→ \<\<cset a5c2833a6b098bd906b77408f2fde10395fb9a69>>