Browse Source

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.
pull/224/head
Brett Cannon 12 years ago
parent
commit
f6901c8baa
  1. 3
      Doc/library/importlib.rst
  2. 3
      Doc/whatsnew/3.4.rst
  3. 2
      Lib/importlib/_bootstrap.py
  4. 3
      Misc/NEWS
  5. 1586
      Python/importlib.h

3
Doc/library/importlib.rst

@ -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.

3
Doc/whatsnew/3.4.rst

@ -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 ``'.'``.

2
Lib/importlib/_bootstrap.py

@ -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()

3
Misc/NEWS

@ -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
File diff suppressed because it is too large
View File

Loading…
Cancel
Save