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 madison.may
Recipients Arfrever, brett.cannon, eric.snow, madison.may, ncoghlan, ronaldoussoren
Date 2013-08-12.02:23:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I'm currently leaning towards having sys.path_importer_cache store 
> the actual directory name.

Exactly what I meant by "Creating a new entry in sys.path_importer_cache after changing directories and importing a new module", but expressed much more succinctly :)  Good to see we're on pretty much the same page.

Here's a (very) preliminary patch for the issue that stores the directory name as a key in sys.path_importer_cache and ensures module.__file__ is an absolute path. 

I've also modified test_path_importer_cache_empty_string in test_importlib/import_/ to use os.getcwd() instead of os.curdir as the key for sys.path_importer_cache.

Finally, I've added a test to that tests that module.__file__ is equivalent to os.path.abspath(module.__file__).

Look it over when you get a chance and let me know what you would change.  Thanks...
Date User Action Args
2013-08-12 02:23:44madison.maysetrecipients: + madison.may, brett.cannon, ronaldoussoren, ncoghlan, Arfrever, eric.snow
2013-08-12 02:23:44madison.maysetmessageid: <>
2013-08-12 02:23:44madison.maylinkissue18416 messages
2013-08-12 02:23:44madison.maycreate