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 cemasoniv
Recipients cemasoniv
Date 2009-08-03.20:36:01
SpamBayes Score 1.0442758e-12
Marked as misclassified No
Message-id <1249331773.17.0.57338899812.issue6636@psf.upfronthosting.co.za>
In-reply-to
Content
Steps to reproduce:

1) Add to sys.path a path that does not exist
2) Import a module, any module.  This invokes get_path_importer over
every element of sys.path.  The NullImporter __init__ method is called
and an instance created for each non-existing path element in sys.path.
3) Create the path and put a valid module in said path
4) Try to import that module.

Behavior is that the interpreter fails to import.  This behavior seems
local to import.c only.

Attached a test case that shows "failed" for 2.5, 2.6, 3.0. 3.1rc1+.  I
have yet to test on the trunk but I can/will do that if necessary.

I believe I can fix this myself but I want to verify this is incorrect
behavior (a bug) and not an "Undocumented Feature" (or hell, maybe it
*is* documented somewhere).  I've skimmed over PEP 302 and didn't see
any relevant information.

If someone gives me the go ahead (or at least doesn't give me reason not
to), I'll get a patch put together, perhaps for several different "fixes".
History
Date User Action Args
2009-08-03 20:36:14cemasonivsetrecipients: + cemasoniv
2009-08-03 20:36:13cemasonivsetmessageid: <1249331773.17.0.57338899812.issue6636@psf.upfronthosting.co.za>
2009-08-03 20:36:02cemasonivlinkissue6636 messages
2009-08-03 20:36:01cemasonivcreate