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:
parent
2be28a6984
commit
f6901c8baa
|
@ -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.
|
||||
|
|
|
@ -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 ``'.'``.
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
1586
Python/importlib.h
1586
Python/importlib.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue