Skip to content

[plugins] Escape percent signs in Alembic database URL#1163

Merged
frankrousseau merged 1 commit into
cgwire:mainfrom
frankrousseau:fix-plugin-migrations-password-percent
Jul 13, 2026
Merged

[plugins] Escape percent signs in Alembic database URL#1163
frankrousseau merged 1 commit into
cgwire:mainfrom
frankrousseau:fix-plugin-migrations-password-percent

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problem

  • zou install-plugin crashes when the PostgreSQL password contains special characters (e.g. !): the password is percent-encoded in the SQLAlchemy URL and configparser, used internally by Alembic, rejects the resulting % sequences as invalid interpolation tokens.

Solution

  • Escape % as %% when setting sqlalchemy.url in the plugin Alembic config, exactly like the core migration config already does in cli.py. The value is unescaped back by configparser when env.py reads it.
  • Add a test checking the config round-trips a percent-encoded database URI.

Fix #1117

Plugin migrations crashed at install time when the PostgreSQL password
contained percent-encoded characters (e.g. "!" encoded as "%21"),
because configparser treats "%" as an interpolation token. Apply the
same escaping as the core migration config in cli.py.

Fix cgwire#1117

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@frankrousseau
frankrousseau merged commit 92dfc1e into cgwire:main Jul 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin install with special characters in Postgres password

1 participant