Author p-ganssle
Recipients Antony.Lee, WGH, brett.cannon, p-ganssle
Date 2018-01-26.17:15:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516986918.46.0.467229070634.issue25330@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2018-01-26 17:15:18p-gansslesetrecipients: + p-ganssle, brett.cannon, Antony.Lee, WGH
2018-01-26 17:15:18p-gansslesetmessageid: <1516986918.46.0.467229070634.issue25330@psf.upfronthosting.co.za>
2018-01-26 17:15:18p-gansslelinkissue25330 messages
2018-01-26 17:15:18p-gansslecreate