File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -165,9 +165,11 @@ def _modify_metadata_for_mariadb():
165165# my_important_option = config.get_main_option("my_important_option")
166166# ... etc.
167167
168+ # Escape '%' characters in URL to avoid configparser interpolation errors
169+ # (e.g., URL-encoded passwords like %40 for '@')
168170config .set_main_option (
169171 "sqlalchemy.url" ,
170- settings .database_url ,
172+ settings .database_url . replace ( "%" , "%%" ) ,
171173)
172174
173175
Original file line number Diff line number Diff line change @@ -258,7 +258,10 @@ async def main() -> None:
258258
259259 with engine .begin () as conn :
260260 cfg .attributes ["connection" ] = conn
261- cfg .set_main_option ("sqlalchemy.url" , settings .database_url )
261+ # Escape '%' characters in URL to avoid configparser interpolation errors
262+ # (e.g., URL-encoded passwords like %40 for '@')
263+ escaped_url = settings .database_url .replace ("%" , "%%" )
264+ cfg .set_main_option ("sqlalchemy.url" , escaped_url )
262265
263266 insp = inspect (conn )
264267
You can’t perform that action at this time.
0 commit comments