X Tutup
Skip to content

bpo-46353: Fix "pydoc -k" when a module fails to load#30557

Open
dlax wants to merge 1 commit intopython:mainfrom
dlax:issue46353
Open

bpo-46353: Fix "pydoc -k" when a module fails to load#30557
dlax wants to merge 1 commit intopython:mainfrom
dlax:issue46353

Conversation

@dlax
Copy link
Contributor

@dlax dlax commented Jan 12, 2022

The 'spec' value, here coming from pkgutil._get_spec(), may be None
because .find_module() may return None. We account for this in
pydoc's ModuleScanner and skip such modules scan.

https://bugs.python.org/issue46353

The 'spec' value, here coming from pkgutil._get_spec(), may be None
because <importer>.find_module() may return None. We account for this in
pydoc's ModuleScanner and skip such modules scan.
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Is there any good way to test this?

@dlax
Copy link
Contributor Author

dlax commented Jan 17, 2022

Is there any good way to test this?

That did not appear easy at first sight. That's typically something that a type checker would catch.
If a test is needed, I can have a second look though.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 17, 2022
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup