From e7b3a459af2d20c67d57c95b85955456450bde13 Mon Sep 17 00:00:00 2001 From: luckyabsoluter <80892490+luckyabsoluter@users.noreply.github.com> Date: Mon, 20 Apr 2026 09:39:44 +0000 Subject: [PATCH] Fix hardcoded /tmp path for Unix socket in lock_files Problem: - The lock_files function previously hardcoded /tmp as the directory for the Unix socket path. - This causes compatibility issues on platforms or specific environments that use a different temporary directory, or even lack access to /tmp entirely. Actions: - Updated the X11 Unix socket path generation to dynamically use tempfile.gettempdir(). Result: - The Unix socket path now correctly adapts to the system's runtime configuration (e.g., OS defaults or TMPDIR environment variables), improving cross-platform compatibility. --- sbvirtualdisplay/abstractdisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbvirtualdisplay/abstractdisplay.py b/sbvirtualdisplay/abstractdisplay.py index b343482..8ddfef5 100644 --- a/sbvirtualdisplay/abstractdisplay.py +++ b/sbvirtualdisplay/abstractdisplay.py @@ -38,7 +38,7 @@ def _cmd(self): raise NotImplementedError() def lock_files(self): - tmpdir = "/tmp" + tmpdir = tempfile.gettempdir() pattern = ".X*-lock" # remove path.py dependency names = fnmatch.filter(os.listdir(tmpdir), pattern)