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 ncoghlan
Recipients brett.cannon, docs@python, iko, ncoghlan
Date 2012-07-08.11:33:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1341747202.2.0.101298880199.issue15292@psf.upfronthosting.co.za>
In-reply-to
Content
The PyPy and 3.3 behaviour are actually correct according to the spec, but it's *really* unclear in PEP 302.

sys.meta_path accepts finder objects. These are explicitly documented as returning "None" from find_module() to indicate "try the next one" and raising exceptions solely to report problems.

However, for reasons that are unknown to me, sys.path_hooks entries (which occupy most of the section on registering hooks) use a different protocol to indicate "try the next one": raising ImportError.

Since meta_path and path_hooks are described in the same section, and the meta_path description just says "add finder objects", it's understandable that implementors take the path_hooks protocol description as applying to finders in general :(

I would chalk the 2.x (and likely 3.x for x < 3) behaviour up to the only partial implementation of PEP 302 in CPython (until Brett's success in bootstrapping importlib for 3.3).
History
Date User Action Args
2012-07-08 11:33:22ncoghlansetrecipients: + ncoghlan, brett.cannon, iko, docs@python
2012-07-08 11:33:22ncoghlansetmessageid: <1341747202.2.0.101298880199.issue15292@psf.upfronthosting.co.za>
2012-07-08 11:33:21ncoghlanlinkissue15292 messages
2012-07-08 11:33:21ncoghlancreate