cpython/Lib/test/test_importlib
Brett Cannon 27e27f7ee1 Issue #18416: Have importlib.machinery.PathFinder treat '' as the cwd
and stop importlib.machinery.FileFinder treating '' as '.'.

Previous PathFinder transformed '' into '.' which led to __file__ for
modules imported from the cwd to always be relative paths. This meant
the values of the attribute were wrong as soon as the cwd changed.
This change now means that as long as the site module is run (which
makes all entries in sys.path absolute) then all values for __file__
will also be absolute unless it's for __main__ when specified by file
path in a relative way (modules imported by runpy will have an
absolute path).

Now that PathFinder is no longer treating '' as '.' it only makes
sense for FileFinder to stop doing so as well. Now no transformation
is performed for the directory given to the __init__ method.

Thanks to Madison May for the initial patch.
2013-10-18 11:39:04 -04:00
..
builtin
extension Issue #16826: Revert fix while Windows issues are being worked out. 2013-09-03 19:54:40 -05:00
frozen Issue #17177: stop using imp in test_importlib 2013-06-15 18:39:21 -04:00
import_ Issue #18416: Have importlib.machinery.PathFinder treat '' as the cwd 2013-10-18 11:39:04 -04:00
source Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script 2013-09-16 23:57:00 +03:00
__init__.py
__main__.py
abc.py
regrtest.py
test_abc.py [issue 19152] Ensure we have actually registered ExtensionFileLoader as an ExecutionLoader. 2013-10-04 20:28:52 -06:00
test_api.py Issue #16803: test.test_importlib.test_api now runs under frozen and 2013-10-18 10:45:59 -04:00
test_locks.py
test_util.py Issue #18076: Introduce imoportlib.util.decode_source(). 2013-06-16 18:37:53 -04:00
util.py Issue #16803: Run test.test_importlib.test_abc under both 2013-10-04 14:47:14 -04:00