[docs] [issue28424] pkgutil.get_data() doesn't work with namespace packages

Nick Coghlan report at bugs.python.org
Sat Oct 15 02:55:16 EDT 2016


Nick Coghlan added the comment:

For 3.4/5/6, I agree this is a documentation issue, where the data files need to be given a *non*-namespaced directory to live in. However, it's worth explicitly noting that subpackages of namespace packages can themselves be regular packages, so one possible solution is to do:

    pkg_util.get_data('my_namespace.my_package_data', 'resourcename')

rather than storing the data directly at the namespace level.

----------
versions: +Python 3.6

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


More information about the docs mailing list