Issue #19410: Put back in special-casing of '' for

importlib.machinery.FileFinder.

While originally moved to stop special-casing '' as PathFinder farther
up the typical call chain now uses the cwd in the instance of '', it
was deemed an unnecessary risk to breaking subclasses of FileFinder to
take the special-casing out.
This commit is contained in:
Brett Cannon 2013-11-01 10:37:57 -04:00
parent 2be28a6984
commit f6901c8baa
5 changed files with 797 additions and 800 deletions

View File

@ -753,9 +753,6 @@ find and load modules.
.. versionadded:: 3.3
.. versionchanged:: 3.4
The empty string is no longer special-cased to be changed into ``'.'``.
.. attribute:: path
The path the finder will search in.

View File

@ -812,6 +812,3 @@ that may require changes to your code.
working directory will also now have an absolute path, including when using
``-m`` with the interpreter (this does not influence when the path to a file
is specified on the command-line).
* :class:`importlib.machinery.FileFinder` no longer special-cases the empty string
to be changed to ``'.'``.

View File

@ -1375,7 +1375,7 @@ class FileFinder:
loaders.extend((suffix, loader) for suffix in suffixes)
self._loaders = loaders
# Base (directory) path
self.path = path
self.path = path or '.'
self._path_mtime = -1
self._path_cache = set()
self._relaxed_path_cache = set()

View File

@ -31,6 +31,9 @@ Core and Builtins
Library
-------
- Issue #19410: Undo the special-casing removal of '' for
importlib.machinery.FileFinder.
- Issue #19424: Fix the warnings module to accept filename containing surrogate
characters.

File diff suppressed because it is too large Load Diff