From 66b260cea9dce11d97f608dd59e85439479ed8f8 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 20 Sep 2024 22:25:36 +0000 Subject: [PATCH] pkgres: fix tiny leak in template loader --- copyparty/httpsrv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index f89523fb..04e230cb 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -93,7 +93,8 @@ if not hasattr(socket, "AF_UNIX"): def load_jinja2_resource(E: EnvParams, name: str): - return load_resource(E, "web/" + name, "r").read() + with load_resource(E, "web/" + name, "r") as f: + return f.read() class HttpSrv(object):