Skip to content

'KeyError': index out of bounds on patch.remove #176

@alejandromumo

Description

@alejandromumo

This bug relates to the following lines:

dest = dot_lookup(destination, node)
if isinstance(dest, SET_TYPES):
dest -= value
else:
del dest[key]

Description:

  • destination is an array that is constantly mutated by dest[del]
  • key is computed in an outter scope. On Zenodo, it's pre-computed based on the original field's array (e.g. 'authors' of a deposit).
  • At some point, the array might be smaller than the original one and dest[key] can raise a IndexError. This was observed when a deposit had multiple changes to the author's list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions