Auto execute in the correct directory#1410
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the credits/update_credits_licenses.py helper script so it can be executed from outside the credits/ directory while still downloading license files into the intended location.
Changes:
- Import
os/pathlib.Pathand change the process working directory to the script’s directory before downloading.
| os.chdir(Path(__file__).parent) | ||
|
|
There was a problem hiding this comment.
Changing the process working directory at import time (os.chdir(...)) creates a global side effect that can break callers (e.g., if this script is invoked from another Python process or imported for reuse). Prefer keeping the original CWD and writing downloads to an explicit output_dir derived from Path(__file__).resolve().parent (use that path when opening the output file); if you keep chdir, at least move it (and the download loop) under an if __name__ == "__main__" guard.
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
No description provided.