From c5f43e8f4a1ad774b7765f84562369810015f205 Mon Sep 17 00:00:00 2001 From: Barcode Betty Date: Sat, 4 Apr 2026 06:31:48 +0000 Subject: [PATCH] fix(api): escape percent signs in alembic database URL for configparser CNPG-generated passwords containing URL-encoded chars (e.g. %2B, %2F) cause configparser.BasicInterpolation to fail with "invalid interpolation syntax". Escaping % as %% prevents this. Co-Authored-By: Paperclip --- alembic/env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alembic/env.py b/alembic/env.py index 3e563e1..694d4dc 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -18,7 +18,7 @@ if not db_url: "CARTSNITCH_DATABASE_URL_SYNC must be set. " "Example: postgresql://user:pass@localhost:5432/cartsnitch" ) -config.set_main_option("sqlalchemy.url", db_url) +config.set_main_option("sqlalchemy.url", db_url.replace("%", "%%")) target_metadata = Base.metadata