This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients amaury.forgeotdarc, brett.cannon, georg.brandl, r.david.murray
Date 2012-06-20.06:41:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340174505.36.0.832954950835.issue15110@psf.upfronthosting.co.za>
In-reply-to
Content
I agree that this is not helpful at all in the usual case, i.e. when you *don't* want to debug importlib.  The one frame in actual user code (distutils in this case) in the middle is kind of hard to spot, but it is what you want to know.  Note that Amaury's example is quite small; in other projects the import chains may go on for 10-20 modules until the ImportError is raised.  Good luck finding out where the bad module was imported without cursing.

This is different from the normal case in user code calling stdlib code, which raises an exception: the user code frames will be near the top, and the stdlib code near the bottom.

I see several options here, in no particular order of preference:

1. special-case importlib._bootstrap when printing tracebacks
2. rewrite the traceback object when raising ImportErrors from importlib
5. (is there more?)
History
Date User Action Args
2012-06-20 06:41:45georg.brandlsetrecipients: + georg.brandl, brett.cannon, amaury.forgeotdarc, r.david.murray
2012-06-20 06:41:45georg.brandlsetmessageid: <1340174505.36.0.832954950835.issue15110@psf.upfronthosting.co.za>
2012-06-20 06:41:44georg.brandllinkissue15110 messages
2012-06-20 06:41:43georg.brandlcreate