From 368321d07ddb2357361f2a94e0ba7e25bc508d99 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Fri, 8 Sep 2023 13:24:51 +0200 Subject: [PATCH] Close python wheel directory file descriptor after read (#753) ## Changes Close python wheel directory file descriptor after read --- python/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/utils.go b/python/utils.go index a8408fae..47d5462d 100644 --- a/python/utils.go +++ b/python/utils.go @@ -30,6 +30,8 @@ func FindFilesWithSuffixInPath(dir, suffix string) []string { log.Debugf(context.Background(), "open dir %s: %s", dir, err) return nil } + defer f.Close() + entries, err := f.ReadDir(0) if err != nil { log.Debugf(context.Background(), "read dir %s: %s", dir, err)