From 9a2120734f819eaffc8dd1bb23ef334c0150c043 Mon Sep 17 00:00:00 2001 From: PerryLink <255665900+PerryLink@users.noreply.github.com> Date: Sun, 18 Oct 2026 04:05:15 +0000 Subject: [PATCH] fix: detect Windows long paths from the real extracted path --- platformio/package/unpack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/package/unpack.py b/platformio/package/unpack.py index 3331ac2e89..76fe1c3824 100644 --- a/platformio/package/unpack.py +++ b/platformio/package/unpack.py @@ -70,7 +70,9 @@ def extract_item(self, item, dest_dir, **kwargs): self._afo.extract(item, dest_dir, **kwargs) except FileNotFoundError as exc: src_path = self.get_item_filename(item) - if IS_WINDOWS and (len(src_path) + len(dest_dir) > 260): + if IS_WINDOWS and ( + len(os.path.join(os.path.abspath(dest_dir), src_path)) > 260 + ): raise WindowsLongPathError(src_path, dest_dir) from exc raise exc self.after_extract(item, dest_dir)