Skip to content

fix(JinjaSetup, TemplateDir): bind root from os.walk to fix NameError in recursive search#175

Open
SoundMatt wants to merge 1 commit into
COVESA:masterfrom
SoundMatt:fix/jinjasetup-templatedir-root-nameerror
Open

fix(JinjaSetup, TemplateDir): bind root from os.walk to fix NameError in recursive search#175
SoundMatt wants to merge 1 commit into
COVESA:masterfrom
SoundMatt:fix/jinjasetup-templatedir-root-nameerror

Conversation

@SoundMatt

Copy link
Copy Markdown

Both find_matching_template_files implementations unpacked os.walk as for _, _, filenames, discarding the root directory string. The body then built file paths using os.path.join(root, ff), referencing an undefined variable. Calling either function with recurse=True raises a NameError.

Fix by binding the first value to root instead of discarding it with _.

…ecursive template search

Both `find_matching_template_files` functions discarded the first value
from `os.walk` using `_`, then constructed file paths with `root` — a
variable that was therefore never defined, causing a `NameError` when
the recursive code path was taken.  Capture it as `root`.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

Signed-off-by: Matt Jones <[email protected]>
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