Message194918
> 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... |
|
Date |
User |
Action |
Args |
2013-08-12 02:23:44 | madison.may | set | recipients:
+ madison.may, brett.cannon, ronaldoussoren, ncoghlan, Arfrever, eric.snow |
2013-08-12 02:23:44 | madison.may | set | messageid: <1376274224.39.0.660037013063.issue18416@psf.upfronthosting.co.za> |
2013-08-12 02:23:44 | madison.may | link | issue18416 messages |
2013-08-12 02:23:44 | madison.may | create | |
|