[New-bugs-announce] [issue28424] pkgutil.get_data() doesn't work with namespace packages

Douglas Greiman report at bugs.python.org
Wed Oct 12 19:36:00 EDT 2016


New submission from Douglas Greiman:

pkg_util.get_data('mypackage', 'resourcename')

returns None if 'mypackage' is a namespace package, because the package object has no __file__ attribute.  A shell script is attached to reproduce this.

This is either a bug to be fixed (my preference) or behavior to be documented.  If there is equivalent, working functionality in the new importlib, that would also be a good to document.

----------
components: Library (Lib)
files: namespace_package_get_data.sh
messages: 278543
nosy: dgreiman
priority: normal
severity: normal
status: open
title: pkgutil.get_data() doesn't work with namespace packages
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file45068/namespace_package_get_data.sh

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


More information about the New-bugs-announce mailing list