[New-bugs-announce] [issue20703] RuntimeError caused by lazy imports in pdb

Xavier de Gaye report at bugs.python.org
Thu Feb 20 17:47:20 CET 2014

New submission from Xavier de Gaye:

Issuing the 'continue' pdb command with a lazy_import.py script as:

# START of lazy_import.py
import sys, pdb

for m in sys.modules:
    if m == 'sys':

# END of lazy_import.py

gives the following output:

$ python lazy_import.py
> lazy_import.py(3)<module>()
-> for m in sys.modules:
(Pdb) continue
Traceback (most recent call last):
  File "lazy_import.py", line 3, in <module>
    for m in sys.modules:
RuntimeError: dictionary changed size during iteration

components: Library (Lib)
messages: 211737
nosy: georg.brandl, xdegaye
priority: normal
severity: normal
status: open
title: RuntimeError caused by lazy imports in pdb
type: behavior
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list