fix: import pathlib in rleapp.py so --custom_artifacts_path works - #381
Merged
Conversation
main() calls pathlib.Path(args.custom_artifacts_path) at line 195, but
pathlib was never imported and is not re-exported by any of the three
wildcard imports at the top of the file. Passing the flag therefore aborted
before doing anything:
File "rleapp.py", line 195, in main
loader_paths.append(pathlib.Path(args.custom_artifacts_path))
NameError: name 'pathlib' is not defined
Reproduced against main with `rleapp.py --custom_artifacts_path <dir> -p`,
and confirmed fixed by the same command, which now loads the extra path and
finishes normally.
pylint had been reporting this as E0602 on every run; it went unnoticed
because the repo had no lint workflow until now. The diff-aware check added
in #380 would not have caught it either, since it predates the change it
measures against.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
main()callspathlib.Path(args.custom_artifacts_path)at line 195, butpathlibis never imported, and it is not re-exported by any of the three wildcard imports at the top of the file (checked each one). Passing the flag aborts before anything happens.Reproduced against
mainThe flag has presumably never worked. Line 195 sits immediately after
parse_args()with no early exit before it, so the crash is unconditional whenever the option is supplied.After
Same command completes normally, loading the extra path:
Why it went unnoticed
pylint has been reporting it on every run:
but the repo had no lint workflow until #380, so nothing surfaced it. Worth noting that the diff-aware check added there would not catch this either — it fails only on warnings a change introduces, and this one predates any change. It showed up because I was measuring the pre-existing baseline while writing that workflow.
rleapp.pygoes from 14 pre-existing warnings to 13; the new lint gate reportsNo new warnings introduced (1 fewer than before). PASS.🤖 Generated with Claude Code