summaryrefslogtreecommitdiff
path: root/generate-cimonitor-dashboard.py
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2023-06-21 14:22:47 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2023-06-22 12:28:42 +0000
commit40833587024409b42c8c6bf013a2d08109f6ee6d (patch)
treec0b267effde7bf52380b1ad14d188105498d77da /generate-cimonitor-dashboard.py
parentee810a04ff2862294d7377eae60e10642c455e6a (diff)
generate-cimonitor-dashboard.py: Fix file descriptors leak
tmpf, tmpnm=tempfile.mkstemp(...) returns an open file descriptor in tmpf, there is no need to call tmpf = open(tmpnm,'r') which moreover implies that the original tmpf is never closed, leading to "Too many open files" errors. Change-Id: I4973beac74026741bc811f002dff67e81524761d
Diffstat (limited to 'generate-cimonitor-dashboard.py')
-rwxr-xr-xgenerate-cimonitor-dashboard.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/generate-cimonitor-dashboard.py b/generate-cimonitor-dashboard.py
index bb4866f1..7a2bb2a7 100755
--- a/generate-cimonitor-dashboard.py
+++ b/generate-cimonitor-dashboard.py
@@ -33,7 +33,6 @@ def nice_print(data):
def download_and_open(url):
tmpf, tmpnm=tempfile.mkstemp()
os.system("wget " + "-o /dev/null " + "-O " + tmpnm + " " + url)
- tmpf = open(tmpnm,'r')
return tmpf, tmpnm
def close_and_remove(tmpf, tmpnm):