Version 5.4.0 has been released with wheels for Python 3.11 - 3.15
Python support
- Add support for Python 3.15, including wheels, all on PyPI now, by @keitherskine
- Drop support for EOL Python 3.10 by @keitherskine in #1508
- Drop support for EOL Python 3.9 by @mkleehammer in #1499
Behavior changes
- DECIMAL and NUMERIC values are now fetched using SQL_NUMERIC_STRUCT by default, so they are
no longer affected by the locale's decimal separator. SetConnection.fetch_decimal_as_string = True
to restore the previous text-based behavior. By @bkline in #1470
New features
- Support returning rows as dictionaries (
Cursor.rows_as_dicts) by @bkline in #1487 - Add support for SQLTablePrivileges (
Cursor.tablePrivileges()) by @bkline in #1463 - Expose the native ODBC handles (
pyodbc.henv,Connection.hdbc,Cursor.hstmt) by @bkline in #1493 - Make driver_completion configurable (
connect(driver_completion=...)) by @bkline in #1488 - Allow setting of connection string attributes (
Connection.set_attr()) by @bkline in #1465 - Support filtering DSN by scope (
dataSources(scope=...)) by @bkline in #1461 - Make initial ReadVarColumn buffer size configurable (
Connection.readvar_initsize) by @bkline in #1490 - Add flag for buggy SQLGetDiagRecW driver behavior (
Connection.compat_diagrec_byte_length) by @bkline in #1464 - Allow fetch of DB2 BLOB by @bkline in #1462
- Fetch messages when DAE kicks in by @bkline in #1468
Bug fixes
- Fix segfaults when a connect fails by @rad-pat in #1510
- Avoid heap corruption with NULLs in TVPs by @bkline in #1452
- Scan all TVP rows before binding by @bkline in #1481
- Keep SetConnectAttrW buffers alive by @bkline in #1472
- attrs_before: snapshot bytearray into immutable bytes by @mkleehammer in #1500
- Fix fast_executemany rounding Decimal parameters to context precision by @M0d3v1 in #1511
- Size the create_name_map name buffer for UTF-32 metadata by @ziyziy89 in #1512
- Fix reference leak in pyodbc.dataSources() by @apoorvdarshan in #1504
- Fix reference leak and double-DECREF in pyodbc.drivers() by @apoorvdarshan in #1505
- Fix .statistics() issue with Unicode table names by @gordthompson in #1460
- Remove incorrect check when unpickling Row by @bkline in #1466
Build and tests
- Enable assertions for test builds and run SQLite tests in CI by @shramov in #1448
- Prevent tests from failing with FreeTDS by @bkline in #1473
- Remove test dependency coupling for testing UUID retrieval by @bkline in #1475
- Replace custom macros with Py_STRINGIFY() by @bkline in #1485
- Use ODBC Driver 18.6.2.1 for Windows tests now that the TVP crash is fixed by @mkleehammer in #1498
- CI, test, and typing improvements throughout, and SQL Server 2025 in CI, by @keitherskine
Thanks
- @keitherskine for once again keeping the wheel builds and CI current, including Python 3.15.
- @bkline for the large majority of this release's features and fixes.
New Contributors
- @rad-pat made their first contribution in #1510
- @apoorvdarshan made their first contribution in #1504
- @M0d3v1 made their first contribution in #1511
- @ziyziy89 made their first contribution in #1512
Full Changelog: 5.3.0...5.4.0