diff options
Diffstat (limited to 'Doc/reference/import.rst')
| -rw-r--r-- | Doc/reference/import.rst | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index e9b7e53..99b77be 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -459,7 +459,8 @@ import machinery will create the new module itself. * If loading fails, the loader must remove any modules it has inserted into :data:`sys.modules`, but it must remove **only** the failing - module, and only if the loader itself has loaded it explicitly. + module(s), and only if the loader itself has loaded the module(s) + explicitly. Module spec ----------- @@ -753,6 +754,15 @@ hook` callables on :data:`sys.path_hooks`, then the following protocol is used to ask the finder for a module spec, which is then used when loading the module. +The current working directory -- denoted by an empty string -- is handled +slightly differently from other entries on :data:`sys.path`. First, if the +current working directory is found to not exist, no value is stored in +:data:`sys.path_importer_cache`. Second, the value for the current working +directory is looked up fresh for each module lookup. Third, the path used for +:data:`sys.path_importer_cache` and returned by +:meth:`importlib.machinery.PathFinder.find_spec` will be the actual current +working directory and not the empty string. + Path entry finder protocol -------------------------- |
