Paul Ganssle <[email protected]> added the comment:
I'm not sure if this warrants a separate issue, but I also notice this in the
documentation:
> If the package cannot be located or loaded, or it uses a loader which does
> not support get_data, then None is returned. In particular, the loader for
> namespace packages does not support get_data.
But in reality this seems to raise a FileNotFoundError:
>>> import pkgutil
>>> data = pkgutil.get_data('dateutil.zoneinfo', 'dateutil-zoneinfo.tar.gz')
>>> len(data)
139671
>>> data = pkgutil.get_data('dateutil.zoneinfo', 'foo-bar.tar.gz')
FileNotFoundError: [Errno 2] No such file or directory:
'/usr/lib/python3.6/site-packages/dateutil/zoneinfo/foo-bar.tar.gz'
Am I misunderstanding the documentation, or should the failure mode be
corrected to specify that it raises an error?
----------
nosy: +p-ganssle
versions: +Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue25330>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com