Message310777
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? |
|
Date |
User |
Action |
Args |
2018-01-26 17:15:18 | p-ganssle | set | recipients:
+ p-ganssle, brett.cannon, Antony.Lee, WGH |
2018-01-26 17:15:18 | p-ganssle | set | messageid: <1516986918.46.0.467229070634.issue25330@psf.upfronthosting.co.za> |
2018-01-26 17:15:18 | p-ganssle | link | issue25330 messages |
2018-01-26 17:15:18 | p-ganssle | create | |
|