From 4dccd54cbdc205f3ee7e022d80be159c325bbf24 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:25:08 -0500 Subject: [PATCH] Replace commonprefix() with commonpath() (#3016) --- archinstall/lib/disk/device_handler.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index d1869353..319fbeb3 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -222,9 +222,12 @@ class DeviceHandler: # "mountpoint": "/mnt/archinstall/.snapshots" # "mountpoints": ["/mnt/archinstall/.snapshots", "/mnt/archinstall/home", ..] # so we'll determine the minimum common path and assume that's the root - path_strings = [str(m) for m in lsblk_info.mountpoints] - common_prefix = os.path.commonprefix(path_strings) - mountpoint = Path(common_prefix) + try: + common_path = os.path.commonpath(lsblk_info.mountpoints) + except ValueError: + return subvol_infos + + mountpoint = Path(common_path) try: result = SysCommand(f'btrfs subvolume list {mountpoint}').decode()