Author Anthony Sottile
Recipients Anthony Sottile
Date 2021-05-27.15:30:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org>
In-reply-to
Content
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
```
History
Date User Action Args
2021-05-27 15:30:11Anthony Sottilesetrecipients: + Anthony Sottile
2021-05-27 15:30:11Anthony Sottilesetmessageid: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org>
2021-05-27 15:30:11Anthony Sottilelinkissue44246 messages
2021-05-27 15:30:10Anthony Sottilecreate