Message407324
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') |
|
Date |
User |
Action |
Args |
2021-11-29 20:57:45 | godlygeek | set | recipients:
+ godlygeek, brett.cannon, ncoghlan, eric.snow, pablogsal |
2021-11-29 20:57:45 | godlygeek | set | messageid: <1638219465.16.0.161029051894.issue45675@roundup.psfhosted.org> |
2021-11-29 20:57:45 | godlygeek | link | issue45675 messages |
2021-11-29 20:57:45 | godlygeek | create | |
|