From b8891fe6fd030105d07e98024ac74a8c51c08405 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 10 Sep 2026 17:34:51 +0200 Subject: [PATCH] fix(app): print the startup line only when app.py runs as a script The "Starting app on host:port" line sat at module level, so every import printed it, including the test suites and any WSGI server that loads the module; CodeQL reported it as a print during import. It now lives in the __main__ block, which the Docker CMD and the e2e runner reach through python app.py; the e2e Flask log still shows the line. Co-Authored-By: Claude Opus 5 (1M context) --- app/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.py b/app/app.py index e2b3701..dba4627 100644 --- a/app/app.py +++ b/app/app.py @@ -28,7 +28,6 @@ logging.basicConfig(level=logging.DEBUG) FLASK_ENV = os.getenv("FLASK_ENV", "production") FLASK_HOST = os.getenv("FLASK_HOST", "127.0.0.1") FLASK_PORT = int(os.getenv("FLASK_PORT", os.getenv("PORT", 5000))) -print(f"Starting app on {FLASK_HOST}:{FLASK_PORT}, FLASK_ENV={FLASK_ENV}") # Initialize the CacheManager cache_manager = CacheManager() @@ -190,6 +189,7 @@ def localized_index(lang): if __name__ == "__main__": + print(f"Starting app on {FLASK_HOST}:{FLASK_PORT}, FLASK_ENV={FLASK_ENV}") app.run( debug=(FLASK_ENV == "development"), host=FLASK_HOST,