Skip to content

Fix relaxed resolver paths with missing intermediate nodes - #282

Open
Gonghan-Princess wants to merge 1 commit into
c0fec0de:mainfrom
Gonghan-Princess:codex/fix-relaxed-resolver-paths
Open

Gonghan-Princess wants to merge 1 commit into
c0fec0de:mainfrom
Gonghan-Princess:codex/fix-relaxed-resolver-paths

Conversation

@Gonghan-Princess

Copy link
Copy Markdown

When a path contains a missing intermediate child, Resolver(relax=True).get() currently continues traversing None and raises AttributeError. For example, both missing/child and missing/.. fail instead of returning None.

Return immediately when child resolution fails. Regression tests cover relative and absolute paths, a missing child below an existing node, custom separators, and case-insensitive matching. They also verify strict mode preserves ChildResolverError and its missing-child context.

Fixes #264.

Validation

Tested on Windows with Python 3.12.10 and the repository's previously frozen development environment:

  • Regression tests before the fix: all 16 cases failed with the expected AttributeError.
  • Resolver tests and doctests: 28 passed.
  • Full pytest -vv suite: 250 passed, 1 skipped; 98% total coverage. The skipped image-export test requires Graphviz, which is unavailable locally. Reference fixtures were read as their exact committed LF bytes for the test run to avoid Windows checkout conversion, then restored to normal checkout state.
  • pre-commit run --all-files: passed all applicable hooks.
  • mypy src: passed for all 33 source files.
  • Sphinx HTML build: succeeded. Its 29 warning messages exactly match the recorded base build.
  • git diff --check: passed.

AI assistance

OpenAI Codex assisted with diagnosis, implementation, tests, and this description. No third-party code or assets were introduced; the changes are submitted under the project's existing license.

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.

Relaxed Resolver Raising Error

1 participant