Skip to content

fix: honor overridden path iterators during file lookup - #640

Open
KennyMcSimpson wants to merge 1 commit into
tox-dev:mainfrom
KennyMcSimpson:fix/subclass-file-lookup
Open

KennyMcSimpson wants to merge 1 commit into
tox-dev:mainfrom
KennyMcSimpson:fix/subclass-file-lookup

Conversation

@KennyMcSimpson

Copy link
Copy Markdown

find_config_file() and its equivalents promise to search in iter_*_paths() order, but they invoke the methods on PlatformDirsABC directly. Subclasses that customize those public iterators lose their search paths during file lookup, so an existing configuration returned by iter_config_paths() is reported missing.

Resolve each iterator from the concrete class while retaining the copy with ensure_exists=False. Add regressions for all six directory kinds, both lookup forms, ordering and read-only behavior; document the subclass behavior and include a changelog fragment.

Validation on Windows:

  • New regressions fail on the original source: all 12 fail.
  • Official Tox Python 3.12, 3.13 and 3.14: each 2053 passed, 350 skipped; changed-line coverage 100%.
  • All 14 pre-commit hooks, strict type checks, prose and Sphinx with -W, sdist/wheel build, Twine, wheel contents, combined coverage and towncrier fragment checks pass.
  • Python 3.11, 3.15, PyPy and free-threaded CPython were unavailable locally; Linux and macOS were not run locally. Tool/package environments used Python 3.12 because the configured 3.15 is unavailable.

The complete aggregate tox run was followed by a passing fix rerun after normalizing local YAML line endings. No workflow changes are included.

Prepared with AI assistance.

@Eee622

Eee622 commented Oct 24, 2026

Copy link
Copy Markdown

Hell

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants