Skip to content

Fix Config.from_file() silent mode not handling ENOTDIR#5913

Closed
veeceey wants to merge 1 commit intopallets:mainfrom
veeceey:fix/issue-5912
Closed

Fix Config.from_file() silent mode not handling ENOTDIR#5913
veeceey wants to merge 1 commit intopallets:mainfrom
veeceey:fix/issue-5912

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 8, 2026

Summary

fixes #5912

Test plan

  • Added test_config_enotdir_from_file -- verifies from_file(..., silent=True) returns False when ENOTDIR is encountered
  • Added test_config_enotdir_from_pyfile -- documents the existing correct behavior of from_pyfile for the same scenario
  • Verified that test_config_enotdir_from_file fails without the fix (NotADirectoryError is raised)
  • Full test_config.py suite passes (21/21 tests)

🤖 Generated with Claude Code

`Config.from_file()` with `silent=True` did not handle `errno.ENOTDIR`,
causing it to raise an error when a path component is a regular file
instead of a directory. This was inconsistent with `Config.from_pyfile()`,
which has handled ENOTDIR since PR pallets#2581.

fixes pallets#5912

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ThiefMaster
Copy link
Member

🤖 Generated with Claude Code

You really had to use an LLM for a change this small?! 🙈

@davidism davidism closed this Feb 8, 2026
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.

Config.from_file() missing ENOTDIR in silent error handling

3 participants

Comments