From 42625f4b23e7f79888c3808558cf8ccbbbb31c37 Mon Sep 17 00:00:00 2001 From: Mike Mulligan Date: Thu, 1 Oct 2026 07:53:01 -0400 Subject: [PATCH] fix: close the file read_text() opens read_text() returned open(...).read() without closing the file, which left it to garbage collection and raised a ResourceWarning in the test run. Read it inside a with block; the encoding stays utf-8. --- build-manifest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-manifest.py b/build-manifest.py index b10f6b5..a90a229 100644 --- a/build-manifest.py +++ b/build-manifest.py @@ -134,7 +134,10 @@ def resolve_in_repo(repo_root: str, rel: str): def read_text(repo_root: str, name: str): p = os.path.join(repo_root, name) - return open(p, encoding="utf-8").read() if os.path.isfile(p) else None + if not os.path.isfile(p): + return None + with open(p, encoding="utf-8") as fh: + return fh.read() def parse_readme_sections(repo_root: str) -> dict: