From 778af112dbf80bb1b60bb33587ed9fa504bd57c7 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 25 Apr 2026 11:49:03 +0200 Subject: [PATCH] fix: strip script dir from sys.path before imports in x/ Python scripts Python adds the script directory to sys.path[0] at startup and tries to create a FileFinder for it. When the script lives on a 9P FUSE mount the FileFinder init fails before any stdlib import can succeed. sys is a builtin and loads without filesystem access, so strip the path first. Co-Authored-By: Claude Sonnet 4.6 --- scripts/x/elevate | 3 ++- scripts/x/elevate-adapter-superpowerd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/x/elevate b/scripts/x/elevate index 389758c..0c44eae 100755 --- a/scripts/x/elevate +++ b/scripts/x/elevate @@ -7,10 +7,11 @@ for running the command outside the Landlock sandbox. Usage: elevate -- """ +import sys +sys.path = sys.path[1:] # strip script dir — may be a non-navigable fs (e.g. 9P) import json import os import socket -import sys def default_socket_path(): diff --git a/scripts/x/elevate-adapter-superpowerd b/scripts/x/elevate-adapter-superpowerd index 4f42c8b..e5c100f 100755 --- a/scripts/x/elevate-adapter-superpowerd +++ b/scripts/x/elevate-adapter-superpowerd @@ -15,11 +15,12 @@ Environment: SUPERPOWERD_SOCKET override superpowerd socket path SUPERPOWERD_SOCKET_DIR directory containing superpowerd.sock """ +import sys +sys.path = sys.path[1:] # strip script dir — may be a non-navigable fs (e.g. 9P) import json import os import signal import socket -import sys import threading