diff --git a/dangerzone/gui/main_window.py b/dangerzone/gui/main_window.py index 8efc5f3..a94f3c2 100644 --- a/dangerzone/gui/main_window.py +++ b/dangerzone/gui/main_window.py @@ -500,8 +500,8 @@ class WaitingWidgetContainer(WaitingWidget): error: Optional[str] = None try: - is_available, version = self.dangerzone.isolation_provider.check_runtime_version() - if not is_available: + is_greater, version = self.dangerzone.isolation_provider.check_docker_desktop_version() + if not is_greater: error = f"Your Docker version is too old ({version})." print(error) self.dangerzone.isolation_provider.is_runtime_available() diff --git a/dangerzone/isolation_provider/container.py b/dangerzone/isolation_provider/container.py index 17769fe..76e1a4d 100644 --- a/dangerzone/isolation_provider/container.py +++ b/dangerzone/isolation_provider/container.py @@ -201,11 +201,11 @@ class Container(IsolationProvider): return True @staticmethod - def check_runtime_version() -> Tuple[bool, str]: + def check_docker_desktop_version() -> Tuple[bool, str]: # On windows and darwin, check that the minimum version is met if platform.system() != "Linux": with subprocess.Popen( - ["docker", "version", "--format", "'{{.Server.Platform.Name}}'"], + ["docker", "version", "--format", "{{.Server.Platform.Name}}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=get_subprocess_startupinfo(), @@ -214,8 +214,7 @@ class Container(IsolationProvider): if p.returncode != 0: raise NotAvailableContainerTechException("docker", stderr.decode()) # The output is like "Docker Desktop 4.35.1 (173168)" - version = stdout.replace("Docker Desktop", "").split()[0] - + version = stdout.decode().replace("Docker Desktop", "").split()[0] if version < MINIMUM_DOCKER_VERSION[platform.system()]: return False, version return True, ""