[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

Mark Dickinson report at bugs.python.org
Thu May 25 03:32:25 EDT 2017


Mark Dickinson added the comment:

@osantana: you'd need to be using the lock at least in `__setitem__` and `__delitem__` as well, else there's nothing preventing modifications to the dictionary during the `list` call. It may make sense to protect *all* accesses (read or write) to `_data`, though you'd need to either use a re-entrant lock in that case or be very careful about not acquiring the lock twice.

----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30441>
_______________________________________


More information about the Python-bugs-list mailing list