bpo-24744: Raises error in pkgutil.walk_packages if path is str (#1926)

bpo-24744: Raise error in pkgutil.walk_packages if path is str

Previously an empty result list was accidentallly returned, since the
code iterated over the string as if it were the expected list of paths,
and of course found nothing.
This commit is contained in:
Sanyam Khurana 2017-06-13 22:41:14 +05:30 committed by R. David Murray
parent 1eb6c0074d
commit b9c3da5c89
4 changed files with 19 additions and 0 deletions

View file

@ -395,6 +395,10 @@ that may require changes to your code.
Changes in the Python API
-------------------------
* :meth:`pkgutil.walk_packages` now raises ValueError if *path* is a string.
Previously an empty list was returned. (Contributed by Sanyam Khurana in
:issue:`24744`.)
* A format string argument for :meth:`string.Formatter.format`
is now :ref:`positional-only <positional-only_parameter>`.
Passing it as a keyword argument was deprecated in Python 3.5. (Contributed