From e64caccae6a96180a5ae4bbf09b79e8cdb38f730 Mon Sep 17 00:00:00 2001 From: Chuck Date: Thu, 19 Feb 2026 17:02:57 -0500 Subject: [PATCH] fix(starlark): convert Path to str in spec_from_file_location calls The module import helpers were passing Path objects directly to spec_from_file_location(), which caused spec to be None. This broke the Starlark app store browser. - Convert module_path to string in both _get_tronbyte_repository_class and _get_pixlet_renderer_class - Add None checks with clear error messages for debugging Fixes: spec not found for the module 'tronbyte_repository' Co-Authored-By: Claude Sonnet 4.5 --- web_interface/blueprints/api_v3.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/web_interface/blueprints/api_v3.py b/web_interface/blueprints/api_v3.py index 16ae721f..eee146b9 100644 --- a/web_interface/blueprints/api_v3.py +++ b/web_interface/blueprints/api_v3.py @@ -6994,8 +6994,14 @@ def _get_tronbyte_repository_class(): importlib.reload(sys.modules["tronbyte_repository"]) return sys.modules["tronbyte_repository"].TronbyteRepository - spec = importlib.util.spec_from_file_location("tronbyte_repository", module_path) + spec = importlib.util.spec_from_file_location("tronbyte_repository", str(module_path)) + if spec is None: + raise ImportError(f"Failed to create module spec for tronbyte_repository at {module_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Failed to create module from spec for tronbyte_repository") + sys.modules["tronbyte_repository"] = module spec.loader.exec_module(module) return module.TronbyteRepository @@ -7015,8 +7021,14 @@ def _get_pixlet_renderer_class(): importlib.reload(sys.modules["pixlet_renderer"]) return sys.modules["pixlet_renderer"].PixletRenderer - spec = importlib.util.spec_from_file_location("pixlet_renderer", module_path) + spec = importlib.util.spec_from_file_location("pixlet_renderer", str(module_path)) + if spec is None: + raise ImportError(f"Failed to create module spec for pixlet_renderer at {module_path}") + module = importlib.util.module_from_spec(spec) + if module is None: + raise ImportError(f"Failed to create module from spec for pixlet_renderer") + sys.modules["pixlet_renderer"] = module spec.loader.exec_module(module) return module.PixletRenderer