Audit finding (read-only review of gamdl 3.8.5, commit 478c3f2). Cross-checked by two models; both judge it real but low severity.
Lens: reliability / resource hygiene
Suggested grade: Worth exploring
Evidence
gamdl/downloader/downloader.py:119-123 — file handle never closed:
playlist_file_lines = (
playlist_file_path_obj.open("r", encoding="utf8").readlines()
if playlist_file_path_obj.exists()
else []
)
gamdl/cli/cli.py:130-135 — Database(config.database_path, config.overwrite) is created but close() is never called on any exit path; Database.close (gamdl/cli/database.py:44-45) is dead code (verified via repo-wide grep: no caller).
Impact: minor. CPython refcounting closes the readlines() handle promptly, and sqlite3 commits every add(), so no data loss — but explicit cleanup is the correct pattern and costs two one-line changes.
Model verdicts
- luna (gpt-5.6-luna): real, low. "The database should be closed in a try/finally or context-manager path; durability from commits does not eliminate connection/lock cleanup concerns."
- grok (grok-4.6): real (sloppy cleanup, not serious leak), low. "with path.open(...). Close the database in a try/finally (or make Database a context manager)."
Fix direction: wrap the readlines() in a with block; call database.close() at the end of main() (try/finally), or make Database a context manager.
Adopt as upstream contribution candidate? (adopt / adapt / reject)
Audit finding (read-only review of gamdl 3.8.5, commit 478c3f2). Cross-checked by two models; both judge it real but low severity.
Lens: reliability / resource hygiene
Suggested grade: Worth exploring
Evidence
gamdl/downloader/downloader.py:119-123— file handle never closed:gamdl/cli/cli.py:130-135—Database(config.database_path, config.overwrite)is created butclose()is never called on any exit path;Database.close(gamdl/cli/database.py:44-45) is dead code (verified via repo-wide grep: no caller).Impact: minor. CPython refcounting closes the readlines() handle promptly, and sqlite3 commits every
add(), so no data loss — but explicit cleanup is the correct pattern and costs two one-line changes.Model verdicts
Fix direction: wrap the readlines() in a
withblock; calldatabase.close()at the end ofmain()(try/finally), or makeDatabasea context manager.Adopt as upstream contribution candidate? (adopt / adapt / reject)