Exception when loading top_level.txt while loading module help info
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cliff |
Fix Released
|
Medium
|
Doug Hellmann |
Bug Description
In this patch that prepares a mapping of module names to project names,
37 for dist in pkg_resources.
38 try:
39 mod_name = dist.get_
40 except KeyError:
41 # Could not retrieve metadata. Ignore.
42 pass
We attempt to iterate through the set of pkg_resources.
objects. For each one we attempt to read the "top_level.txt" file. However,
not all python packages have a top_level.txt
>>> pkg_resources.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<redacted>
value = self._get(
File "<redacted>
with open(path, 'rb') as stream:
IOError: [Errno 2] No such file or directory: '<redacted>
This raises IOError which is not handled locally since we only catch KeyError
here. This exception causes the cli to exit, and precludes executing any cli
command.
Another note, toplevel.txt, when it is present, is potentially multi-lined, so
strictly speaking, each line should be added to the mapping, so that all the
potential top level modules are mapped to the project name.
First seen in 2.9.0
Changed in python-cliff: | |
status: | New → Triaged |
assignee: | nobody → Doug Hellmann (doug-hellmann) |
importance: | Undecided → Medium |
description: | updated |
Fix proposed to branch: master /review. openstack. org/507679
Review: https:/