[New-bugs-announce] [issue33210] pkgutil.walk_packages gives incomplete results

Cyker Way report at bugs.python.org
Mon Apr 2 22:25:38 EDT 2018

New submission from Cyker Way <cykerway at gmail.com>:

The current implementation of `pkgutil.walk_packages()` is confusing. Users may be given incomplete results while no exception is raised if they don't explicitly provide the `prefix` parameter. The doc says:

>   prefix is a string to output on the front of every module name on output.

But the fact is, `prefix` is not merely an output formatter at all. This function cannot handle an empty prefix (which is the default) and will often encounter import errors which are then simply ignored without an `onerror` function (which is default again).

See test program for details.





components: Library (Lib)
files: test.py
messages: 314850
nosy: cykerway
priority: normal
severity: normal
status: open
title: pkgutil.walk_packages gives incomplete results
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47516/test.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list