This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author godlygeek
Recipients brett.cannon, eric.snow, godlygeek, ncoghlan, pablogsal
Date 2021-11-29.20:57:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638219465.16.0.161029051894.issue45675@roundup.psfhosted.org>
In-reply-to
Content
I wondered if it would be backwards compatible to make `pkgutil.get_data()` delegate to `importlib.resources.read_binary()`. It isn't, because `pkgutil.get_data()` accepts a relative path for the resource, and `importlib.resources.read_binary()` accepts only a filename. That is, you can do:

    pkgutil.get_data(__name__, "subdir/some_file")

but not:

    importlib.resources.read_binary(__name__, "subdir/some_file")

The latter fails with:

      File "/opt/bb/lib/python3.10/importlib/_common.py", line 34, in normalize_path
        raise ValueError(f'{path!r} must be only a file name')
History
Date User Action Args
2021-11-29 20:57:45godlygeeksetrecipients: + godlygeek, brett.cannon, ncoghlan, eric.snow, pablogsal
2021-11-29 20:57:45godlygeeksetmessageid: <1638219465.16.0.161029051894.issue45675@roundup.psfhosted.org>
2021-11-29 20:57:45godlygeeklinkissue45675 messages
2021-11-29 20:57:45godlygeekcreate