mirror of https://github.com/python/cpython.git
Issue #15288: Clarify that pkgutil.walk_packages() and friends will no
longer work as expected in Python 3.3 as importlib's loaders do not implement the non-standard iter_modules() method. Also link to the term "loader" in the requisite notes to help make it clearer what has happened.
This commit is contained in:
parent
19a2f5961c
commit
b19449751f
|
@ -139,8 +139,13 @@ support.
|
||||||
*prefix* is a string to output on the front of every module name on output.
|
*prefix* is a string to output on the front of every module name on output.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Only works for importers which define a ``iter_modules()`` method, which
|
Only works wtih a :term:`loader` which defines a ``iter_modules()``
|
||||||
is non-standard but implemented by classes defined in this module.
|
method, which is non-standard but implemented by classes defined in this
|
||||||
|
module.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.3
|
||||||
|
As of Python 3.3, the import system provides loaders by default, but they
|
||||||
|
do not include the ``iter_modules()`` method required by this function.
|
||||||
|
|
||||||
|
|
||||||
.. function:: walk_packages(path=None, prefix='', onerror=None)
|
.. function:: walk_packages(path=None, prefix='', onerror=None)
|
||||||
|
@ -171,8 +176,12 @@ support.
|
||||||
walk_packages(ctypes.__path__, ctypes.__name__ + '.')
|
walk_packages(ctypes.__path__, ctypes.__name__ + '.')
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Only works for importers which define a ``iter_modules()`` method, which
|
Only works for a :term:`loader` which define a ``iter_modules()`` method,
|
||||||
is non-standard but implemented by classes defined in this module.
|
which is non-standard but implemented by classes defined in this module.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.3
|
||||||
|
As of Python 3.3, the import system provides loaders by default, but they
|
||||||
|
do not include the ``iter_modules()`` method required by this function.
|
||||||
|
|
||||||
|
|
||||||
.. function:: get_data(package, resource)
|
.. function:: get_data(package, resource)
|
||||||
|
|
|
@ -101,6 +101,11 @@ Tools/Demos
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
- Issue #15288: Link to the term "loader" in notes in pkgutil about how things
|
||||||
|
won't work as expected in Python 3.3 and mark the requisite functions as
|
||||||
|
"changed" since they will no longer work with modules directly imported by
|
||||||
|
import itself.
|
||||||
|
|
||||||
- Issue #13557: Clarify effect of giving two different namespaces to exec or
|
- Issue #13557: Clarify effect of giving two different namespaces to exec or
|
||||||
execfile().
|
execfile().
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue