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 <1376274224.39.0.660037013063.issue18416@psf.upfronthosting.co.za>
In-reply-to
Content
> 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_/test_path.py to use os.getcwd() instead of os.curdir as the key for sys.path_importer_cache.

Finally, I've added a test to test_import.py 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...
History
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: <1376274224.39.0.660037013063.issue18416@psf.upfronthosting.co.za>
2013-08-12 02:23:44madison.maylinkissue18416 messages
2013-08-12 02:23:44madison.maycreate