Skip to content

Quitting causes mutated iteration #2

@bubthegreat

Description

@bubthegreat

When trying to quit we get an error - we might need to copy the equipped.values() and then iterate over the copy instead of the original value, or find out why we're mutating this during save (I don't think this should be mutating during save)

12/02/2021 12:17:27 AM INFO     [rom24.commands.do_quit.do_quit:23] Bub has quit.
12/02/2021 12:17:27 AM ERROR    [rom24.comm.game_loop:265] Exception OrderedDict mutated during iteration caught - continuing loop.
Traceback (most recent call last):
  File "/home/bub/Development/rom24/src/rom24/comm.py", line 262, in game_loop
    process_input()
  File "/home/bub/Development/rom24/src/rom24/comm.py", line 25, in process_input
    d.connected()
  File "/home/bub/Development/rom24/src/rom24/nanny.py", line 618, in con_playing
    handler_game.substitute_alias(self, command)
  File "/home/bub/Development/rom24/src/rom24/handler_game.py", line 208, in substitute_alias
    ch.interpret(argument)
  File "/home/bub/Development/rom24/src/rom24/handler_pc.py", line 609, in interpret
    cmd.do_fun(self, argument.lstrip())
  File "/home/bub/Development/rom24/src/rom24/commands/do_quit.py", line 32, in do_quit
    ch.extract(True)
  File "/home/bub/Development/rom24/src/rom24/living.py", line 680, in extract
    for item_id in self.equipped.values():
RuntimeError: OrderedDict mutated during iteration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions