Skip to content

BUG: Catch NotImplementedError in _getmembers_all (#353) - #484

Open
M-Colley wants to merge 1 commit into
pdoc3:masterfrom
M-Colley:fix/issue-353-catch-notimplementederror
Open

M-Colley wants to merge 1 commit into
pdoc3:masterfrom
M-Colley:fix/issue-353-catch-notimplementederror

Conversation

@M-Colley

@M-Colley M-Colley commented Dec 2, 2026

Copy link
Copy Markdown

Class descriptors and metaclass properties that raise NotImplementedError during class attribute lookup crash pdoc.Class initialization. Specifically, _getmembers_all() only catches AttributeError around getattr(obj, name), allowing NotImplementedError to propagate unhandled. Fixes #353.

To handle unimplemented class attributes cleanly, _getmembers_all() in pdoc/__init__.py now catches (AttributeError, NotImplementedError) and falls back to the raw descriptor in the class MRO __dict__ or None. Correspondingly, RegressionsTest.test_class_member_not_implemented_error in pdoc/test/__init__.py verifies documentation and inheritance rendering for descriptors and metaclass properties raising NotImplementedError.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Pdoc fails if a base class uses a NotImplementedError

1 participant