Ask questionsCould not initialize 'report': dictionary keys changed during iteration

In the attempt to package sos in Debian/Ubuntu, I keep facing this situation. Could it be a py3.8 incompatibility or something ?

sos report -a --debug
Could not initialize 'report': dictionary keys changed during iteration
Traceback (most recent call last):
  File "/usr/bin/sos", line 21, in <module>
    sos = SoS(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/sos/", line 121, in __init__
  File "/usr/lib/python3/dist-packages/sos/", line 181, in _init_component
    raise err
  File "/usr/lib/python3/dist-packages/sos/", line 176, in _init_component
    self._component = _to_load(self.parser, self.args, self.cmdline)
  File "/usr/lib/python3/dist-packages/sos/report/", line 120, in __init__
    super(SoSReport, self).__init__(parser, args, cmdline)
  File "/usr/lib/python3/dist-packages/sos/", line 86, in __init__
    self.opts = self.load_options()
  File "/usr/lib/python3/dist-packages/sos/", line 208, in load_options
    opts.update_from_conf(self.args.config_file, self.args.component)
  File "/usr/lib/python3/dist-packages/sos/", line 222, in update_from_conf
    _update_from_section("global", config)
  File "/usr/lib/python3/dist-packages/sos/", line 189, in _update_from_section
    for key in odict.keys():
RuntimeError: dictionary keys changed during iteration

Answer questions slashdd

It seems to do the trick here:


                - for key in odict.keys():
                + for key in list(odict):

Related questions

No questions were found.
Github User Rank List