fix: make preconfigure download paths consistent by shbhmexe · Pull Request #2648 · su2code/SU2
ninja-win.zip saved to CWD but later opened/removed from script dir
FileNotFoundError when running preconfigure.py from outside repo root (Windows)
Download to sys.path[0]/ninja-win.zip and extract from the same path.
Undefined exception variable in download failure path
NameError that hides the real download failure
Use except Exception as e: and print the actual exception.
Module archives saved to CWD but later opened/removed from script dir
FileNotFoundError for non-git source distributions or when using URL downloads from outside repo root
Download to sys.path[0] (expected filepath).
Zip files not closed after extraction
Potential file-handle leaks / Windows file lock issues
Use context managers (with ZipFile(...) as zipf).
Built ninja copied to . instead of script dir (non-Windows)
meson.py expects sys.path[0]/ninja, which can break if invoked from another working directory
Copy to sys.path[0]/ninja.