[New-bugs-announce] [issue24744] Lack of type checks in pkgutil.walk_packages and friends

Cal Leeming report at bugs.python.org
Tue Jul 28 18:11:28 CEST 2015


New submission from Cal Leeming:

The documentation states that pkgutil.walk_packages() path must be None or a list of paths [1]. After passing in a string, the result was a blank list rather than a type error or automatic conversion to a list.

If this method is documented that it must only accept a list or None, then there should surely be type checks to this effect? This was a bit of a gotcha that left me head scratching for 30 minutes (after not realising it only took a list, not an str, which in itself seems a bit odd)

----------
components: Interpreter Core
messages: 247529
nosy: sleepycal
priority: normal
severity: normal
status: open
title: Lack of type checks in pkgutil.walk_packages and friends
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24744>
_______________________________________


More information about the New-bugs-announce mailing list