Skip to content

importlib_metadata.metadata("") start raising ValueError since 4.12.0 #395

@Czaki

Description

@Czaki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy