From b6f399be6ea4c91458d918607531e719bdeda7ec Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Tue, 2 Jul 2024 20:41:58 +0300 Subject: [PATCH] container: Avoid pop-ups on Windows Avoid window pop-ups on Windows systems, by using the `startupinfo` argument of `subprocess.run`. --- dangerzone/isolation_provider/container.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dangerzone/isolation_provider/container.py b/dangerzone/isolation_provider/container.py index 4085039..e6c3c8b 100644 --- a/dangerzone/isolation_provider/container.py +++ b/dangerzone/isolation_provider/container.py @@ -67,7 +67,10 @@ class Container(IsolationProvider): cmd = [runtime, "version", "-f", query] try: version = subprocess.run( - cmd, capture_output=True, check=True + cmd, + startupinfo=get_subprocess_startupinfo(), + capture_output=True, + check=True, ).stdout.decode() except Exception as e: msg = f"Could not get the version of the {runtime.capitalize()} tool: {e}"