There are several ways of getting this error, but judging from the one line of code in this stack, you probably did something like this:
for vname in data: data.pop(vname) You can't change a dictionary while iterating over it. There are many ways around this, but the simplest would be: for vname in data.keys(): data.pop(vname) keys() makes a copy of the dictionary keys, allowing you to modify the dictionary. -tk On Wed, Oct 25, 2017 at 3:39 AM, Robert Mantel <[email protected]> wrote: > I'm using wxmesh to generate loop packets about every 3-5 seconds as they > come in. Now I'm using the modified one that Frederic developed from the > original wxmesh driver to allow partial packets. Seems to work pretty > well, but it seems that at some point this always happens and I'm not sure > what's going on here. Am I trying to generate loop packets too often? I > have it set to generate as quickly as my station send them. > > > Oct 24 23:02:27 raspberrypi weewx[1298]: restx: Shut down Wunderground-RF > thread. > Oct 24 23:02:27 raspberrypi weewx[1298]: engine: Caught unrecoverable > exception in engine: > Oct 24 23:02:27 raspberrypi weewx[1298]: **** dictionary changed size > during iteration > Oct 24 23:02:27 raspberrypi weewx[1298]: **** Traceback (most recent > call last): > Oct 24 23:02:27 raspberrypi weewx[1298]: **** File > "/usr/share/weewx/weewx/engine.py", line 871, in main > Oct 24 23:02:27 raspberrypi weewx[1298]: **** engine.run() > Oct 24 23:02:27 raspberrypi weewx[1298]: **** File > "/usr/share/weewx/weewx/engine.py", line 187, in run > Oct 24 23:02:27 raspberrypi weewx[1298]: **** for packet in > self.console.genLoopPackets(): > Oct 24 23:02:27 raspberrypi weewx[1298]: **** File > "/usr/share/weewx/user/wxMesh.py", line 122, in genLoopPackets > Oct 24 23:02:27 raspberrypi weewx[1298]: **** for vname in data: > Oct 24 23:02:27 raspberrypi weewx[1298]: **** RuntimeError: > dictionary changed size during iteration > Oct 24 23:02:27 raspberrypi weewx[1298]: **** Exiting. > > -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
