Hello,
In napari we use the following code to check the metadata of the package used as a launcher of the application:
app_module = sys.modules['__main__'].__package__
try:
metadata = importlib_metadata.metadata(app_module)
except importlib_metadata.PackageNotFoundError:
...
as importlib_metadata is replacement for importlib.metadata then there is inconsitece as for python 3.8-3.10 the following code executes correctly:
In [2]: importlib.metadata.metadata(None)
Out[2]: <email.message.Message at 0x7fdb7c5ff5e0>
but
importlib_metadata.metadata(None)
ends with error from #391
I found this issue, but as I understand that solution will impact python 3.11 or python 3.12
python/cpython#93259
it is possible to restore old behaviour for old version of python to not break existing code? I understand that new version of libraries should be fixed, but such updates should not break existing code.
Hello,
In
napariwe use the following code to check the metadata of the package used as a launcher of the application:as
importlib_metadatais replacement forimportlib.metadatathen there is inconsitece as for python 3.8-3.10 the following code executes correctly:but
ends with error from #391
I found this issue, but as I understand that solution will impact python 3.11 or python 3.12
python/cpython#93259
it is possible to restore old behaviour for old version of python to not break existing code? I understand that new version of libraries should be fixed, but such updates should not break existing code.