[issue33065] IDLE debugger: problem importing user created module

Brett Cannon report at bugs.python.org
Thu Apr 12 12:36:04 EDT 2018


Brett Cannon <brett at python.org> added the comment:

Without knowing the exact Python version it's hard to tell as line 59 changed between Python 3.5 and where Python 3.6 is now (FYI, the line as it currently sits in Python 3.6 is https://github.com/python/cpython/blob/e98e3385f2acfc6d98f70f8e66c96b752d003b8f/Lib/importlib/_bootstrap.py#L59). But the double-reporting of the same line is a bit odd.

The best I can think of is that IDLE is requesting the __repr__() of `self` while still executing `__init__()` but before `self.name` is set, triggering an AttributeError (although those lines don't exactly line up with that). Otherwise looking at the code for _ModuleLock suggests this really shouldn't happen as `self.name` is set in `__init__()` and there's no use of `del` or `delattr()` that would cause this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33065>
_______________________________________


More information about the Python-bugs-list mailing list