importlib.metadata.version(None) returns arbitrary version number
#93259
Labels
type-bug
An unexpected behavior, bug, or error
The
version()function of theimportlib.metadatapackage returns an arbitrary version number when called withNone. There's no documentation on what the return value means.I would have expected one of the following instead:
distribution_nameparameter cannot beNone, orThe current behaviour is confusing as one could think, for example, that the return value is the version of the project/package they call it from.
I looks like the return value is the version of an arbitrary package installed in the Python virtual environment. Calling the function repeatedly seems to give the same value, but installing a new package can cause the return value to change.
System information
The text was updated successfully, but these errors were encountered: