[issue21335] Update importlib.__init__ to reset _frozen_importlib's loader to SourceFileLoader

Brett Cannon report at bugs.python.org
Fri May 2 19:05:55 CEST 2014


Brett Cannon added the comment:

Even with setting SourceFileLoader, you still don't get file lines back. Why? Because all of the constructed objects in _frozen_importlib have their co_filename set before the back-patching in importlib.__init__ and so when the traceback module tries to do its thing it sees '<frozen importlib._bootstrap>' as the filename instead of importlib._bootstrap.__file__ which doesn't lead to linecache getting anything useful.

IOW a whole lot of effort for code that people should never have to look at.

----------
resolution:  -> rejected
status: open -> closed

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


More information about the Python-bugs-list mailing list