From 5d3139829b09759c3bc5a70e1b7ef45f554984b1 Mon Sep 17 00:00:00 2001 From: Nils Vu Date: Mon, 13 Jan 2025 14:57:12 -0800 Subject: [PATCH] Status CLI: handle permission error --- tools/Status/Status.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/Status/Status.py b/tools/Status/Status.py index df3e57e499b5..c8074b955090 100644 --- a/tools/Status/Status.py +++ b/tools/Status/Status.py @@ -123,6 +123,14 @@ def get_input_file(comment: Optional[str], work_dir: str) -> Optional[str]: # Fallback: Check if there's a single YAML file in the work dir yaml_files = glob.glob(os.path.join(work_dir, "*.yaml")) if len(yaml_files) == 1: + try: + open(yaml_files[0], "r").close() + except PermissionError: + logger.debug( + f"Unable to open potential input file: {yaml_files[0]}.", + exc_info=True, + ) + return None return yaml_files[0] else: logger.debug(