Skip to content

fix: handle missing original_path during placeholder resolution - #561

Open
iamceeso wants to merge 1 commit into
readthedocs:mainfrom
iamceeso:fix-none-original-path-crash
Open

fix: handle missing original_path during placeholder resolution#561
iamceeso wants to merge 1 commit into
readthedocs:mainfrom
iamceeso:fix-none-original-path-crash

Conversation

@iamceeso

Copy link
Copy Markdown

Summary

Prevent AutoAPI from crashing when resolving placeholders with a missing or invalid original_path.

Currently _resolve_module_placeholders() assumes every placeholder contains a valid string original_path and unconditionally calls:

child["original_path"].rsplit(".", 1)

In some projects, malformed or unresolved placeholders may contain None, causing:

AttributeError: 'NoneType' object has no attribute 'rsplit'

This patch defensively validates original_path before use, logs a warning, removes the unresolved placeholder, and continues processing instead of aborting the build.

Result

  • Prevents hard crashes during placeholder resolution
  • Allows documentation generation to complete successfully
  • Preserves existing behavior for valid placeholders

Validation

  • Full tox suite passes
  • Formatting, linting, typechecking, docs, and integration tests all pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant