Closed pelme closed 6 months ago
I had intended to keep compatibility to 3.7, but only test on >=3.9. This breaks that. But it is better to avoid that dependency, so lets go with this.
Thanks! Hopefully most people have moved past 3.7 now :)
This doesn't just break on Python 3.7 but also breaks with AttributeError: module 'importlib.resources' has no attribute 'files'
on Python 3.8.10 which we're still using extensively on Ubuntu 20.04.
Any chance you can revert this change?
Yes. In that case I will look at a modification that enables use of 3.7 and forward.
Since 3.8 was not part of CI i did not think it was supported.
It is probably possible to avoid the error by using importlib.resources.path
instead. That would avoid having to pull in the extra dependency while still supporting Python >=3.7.
It's a bit of a catch-22 situation as importlib.resources.path
is deprecated as of 3.11, while the suggested replacement as_file
was new in 3.9
See also issue #69
This should now be solved and is released in newly published version 1.2.0 on PyPI.
Supporting Python >=3.9 does not require using the backport.
Also, use joinpath() to simplify the retrival of the path+return pathlib.Path instead of str.