From 9651085e4c73c18ee054dd356f3aab4fd03d2086 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Thu, 4 Dec 2025 23:30:49 +0100 Subject: [PATCH] Fix in loading images with python --- cuchulu/app.py | 7 ++++--- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cuchulu/app.py b/cuchulu/app.py index eba0e4e..3089678 100644 --- a/cuchulu/app.py +++ b/cuchulu/app.py @@ -183,10 +183,11 @@ if config.yes_static==True: mimetype=guess_type(path+'/'+filename) return static_file(filename, root=path, mimetype=mimetype[0]) - else: - mimetype=guess_type(path_module+'/'+filename) + elif os.path.isfile(file_path_module): + mimetype=guess_type(file_path_module) return static_file(filename, root=path_module, mimetype=mimetype[0]) - + else: + abort(404, 'File not found') def error_handler_500(e): diff --git a/pyproject.toml b/pyproject.toml index 9eec3f4..be18d0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi" name = "cuchulu" authors = [{name = "Antonio de la Rosa", email = "antonio.delarosa@cuchulu.com"}] readme = "README.md" -version = "1.0.39.1" +version = "1.0.39.2" description = "A simple framework using bottle and mako" # dynamic = ["version", "description"]