[New-bugs-announce] [issue44162] importlib.resources.path no longer supports directories
report at bugs.python.org
Mon May 17 17:13:26 EDT 2021
New submission from T M <teran.mckinney at anthem.com>:
In Python 3.7 and 3.8, importlib.resources.path worked perfectly with a directory.
with importlib.resources.path(__package__, "dir") as dir:
In Python 3.9, this is raised: IsADirectoryError: [Errno 21] Is a directory: 'dir'
I haven't seen this change documented. I don't know if the behavior in 3.7 and 3.8 was a bug, it sure was useful.
In this case, we have web files which we want to serve statically from that folder. Naming them file by file could work, but would be tedious and isn't preferable for us.
title: importlib.resources.path no longer supports directories
versions: Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce