From 94bf34511c28a48ae5f548c9f50acf8ef85f5ce6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 24 Jan 2020 14:00:44 +0100 Subject: Python: T1986: close subprocess channel Without closing the communication channel to the subprocess, Python will complain e.g. when executing vyos-smoketest binary. /usr/lib/python3/dist-packages/vyos/configsession.py:110: ResourceWarning: unclosed file <_io.BufferedReader name=3> self.__run_command([CLI_SHELL_API, 'setupSession']) ResourceWarning: Enable tracemalloc to get the object allocation traceback --- python/vyos/config.py | 1 + 1 file changed, 1 insertion(+) (limited to 'python/vyos/config.py') diff --git a/python/vyos/config.py b/python/vyos/config.py index 6aed8693c..77698ac68 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -140,6 +140,7 @@ class Config(object): p = subprocess.Popen(cmd, stdout=subprocess.PIPE) out = p.stdout.read() p.wait() + p.communicate() if p.returncode != 0: raise VyOSError() else: -- cgit v1.2.3