]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
quote driver name and pass-through keys in pyodbc connect string
authordxbjavid <dxbjavid@gmail.com>
Wed, 17 Jun 2026 12:49:06 +0000 (08:49 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Jun 2026 20:55:28 +0000 (16:55 -0400)
commitc039c9fa57e68443ba87fdff37bd26a8617320c1
tree1b79bd3a6b7dcceab31ba1a48851d659570a4938
parent61e74ff61dae24e4c4eec528e36a71c10bf15294
quote driver name and pass-through keys in pyodbc connect string

Tightened the construction of the ODBC connection string in the pyodbc
connector (as well as the mssql-python connector in 2.1) so that the
driver name, the names of pass-through connection parameters, and values
containing ``}`` are brace-quoted.  Previously a ``}`` in the driver name
or in a pass-through value, or a ``;`` in the name of a pass-through
parameter, could close the surrounding token early and allow the
remainder of the string to be interpreted as additional connection
attributes.  Pull request courtesy dxbjavid.

Fixes: #13380
Closes: #13379
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13379
Pull-request-sha: 34433408bff86a9044be5d431b31688ab6d7578d

Change-Id: I5a0b522e62d306cf6dc59c7f61fe584df02a948d
(cherry picked from commit 8604972666978ca981623c7f415e405bc074663a)
doc/build/changelog/unreleased_20/13380.rst [new file with mode: 0644]
lib/sqlalchemy/connectors/pyodbc.py
test/dialect/mssql/test_engine.py