eReuse / workbench

The eReuse.org Workbench is a toolset to assist with the diagnostic, benchmarking, inventory and installation of computers.
https://www.ereuse.org
GNU Affero General Public License v3.0
13 stars 7 forks source link

Exception after adding two devices #79

Open bustawin opened 7 years ago

bustawin commented 7 years ago

I added a device, and once it started I added another. The result was the following exception:

Traceback (most recent call last):
  File "erasetor.py", line 373, in <module>
    ErasetorServer()
  File "erasetor.py", line 77, in __init__
    wrapper(self.start)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "erasetor.py", line 98, in start
    self.start_erasetor_process()
  File "erasetor.py", line 92, in start_erasetor_process
    main_menu.display()
  File "erasetor.py", line 138, in display
    devices = self.process.get_list()
  File "erasetor.py", line 364, in get_list
    for device in self.devices:
RuntimeError: dictionary changed size during iteration

Note that not always happens, and I couldn't reproduce the error again.

SO: linux mint 18.1 Cinnamon 32-bit

GytNGF commented 7 years ago

This bug should be fixed with this commit. When the dictionary size is changed raises an error. Now when the error is raised same function will be called to get a a complete list again.