New submission from Anthony Sottile <asott...@umich.edu>:
this is breaking code that's unfortunately out of my control (vendor) -- also it looks really wrong ```python import importlib.metadata print('looks like a list:') print(importlib.metadata.distribution('pip').entry_points) print('first item:') print(importlib.metadata.distribution('pip').entry_points[0]) ``` output in 3.9: ```console $ ./venv39/bin/python t.py looks like a list: [EntryPoint(name='pip', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3.8', value='pip._internal.cli.main:main', group='console_scripts')] first item: EntryPoint(name='pip', value='pip._internal.cli.main:main', group='console_scripts') ``` ```console $ venv310/bin/python t.py looks like a list: (EntryPoint(name='pip', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3', value='pip._internal.cli.main:main', group='console_scripts'), EntryPoint(name='pip3.8', value='pip._internal.cli.main:main', group='console_scripts')) first item: Traceback (most recent call last): File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 217, in __getitem__ return next(iter(self.select(name=name))) StopIteration During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/y/t.py", line 5, in <module> print(importlib.metadata.distribution('pip').entry_points[0]) File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 219, in __getitem__ raise KeyError(name) KeyError: 0 ``` ---------- messages: 394548 nosy: Anthony Sottile priority: normal severity: normal status: open title: 3.10 beta 1: breaking change in importlib.metadata entry points versions: Python 3.10 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44246> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com