From 267cae93b6a9b340e0dd193e46b28f24800dc607 Mon Sep 17 00:00:00 2001 From: Jeremy Shen Date: Thu, 11 Jun 2026 15:36:04 +0800 Subject: [PATCH] fix: use tempfile.gettempdir() instead of hardcoded /tmp/ for JTAG TCL file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /tmp/ doesn't exist on Windows — Path('/tmp/...') resolves to C:\tmp\ which fails with 'No such file or directory'. Use tempfile.gettempdir() for cross-platform temp directory resolution. Also cleaned up the get_vivado_path() call (removed obsolete vitis_path kwarg). --- src/zynq_checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zynq_checker.py b/src/zynq_checker.py index 1936a66..7f21130 100644 --- a/src/zynq_checker.py +++ b/src/zynq_checker.py @@ -11,6 +11,7 @@ from __future__ import annotations import os import re import subprocess +import tempfile from dataclasses import dataclass, field from pathlib import Path from typing import Callable @@ -88,7 +89,6 @@ def check_zynq_jtag(config: Config, callback: Callable | None = None) -> ZynqChe # Find vivado executable via Xilinx root scan vivado_path = get_vivado_path( - vitis_path=getattr(config, "vitis_path", ""), xilinx_root=getattr(config, "xilinx_path", ""), ) if not vivado_path: @@ -104,7 +104,7 @@ def check_zynq_jtag(config: Config, callback: Callable | None = None) -> ZynqChe # Create temporary TCL script tcl_content = _build_jtag_query_tcl() - tcl_path = Path("/tmp/zynq_jtag_check_{}.tcl".format(os.getpid())) + tcl_path = Path(tempfile.gettempdir()) / f"zynq_jtag_check_{os.getpid()}.tcl" try: tcl_path.write_text(tcl_content)