Skip to content

Scheduled weekly dependency update for week 35 - #873

Open
pyup-bot wants to merge 34 commits into
masterfrom
pyup-scheduled-update-2026-08-31
Open

Scheduled weekly dependency update for week 35#873
pyup-bot wants to merge 34 commits into
masterfrom
pyup-scheduled-update-2026-08-31

Conversation

@pyup-bot

Copy link
Copy Markdown
Collaborator

Update gevent from 21.1.2 to 26.8.0.

Changelog

26.8.0

===================


Features
--------

- Binary wheels for 3.15 are now built with 3.15rc1. This should be a
stable ABI.



Bugfixes
--------

- Replace ``concurrent.futures.thread._global_shutdown_lock`` when patching
threads, importing that module if needed. ``Executor.submit`` holds it across
``Thread.start()``, so a worker greenlet that forks runs the
:func:`os.register_at_fork` handlers it is registered with while another
greenlet holds it: a native lock deadlocked, a cooperative one parked the
greenlet inside ``os.fork()`` (which ``filelock`` 3.30 rejects).

Like the rest of ``patch_thread(existing_locks=True)``, this needs the process
to be single threaded when patching.
See :issue:`1865`.
- Fixed a semaphore acquired and released by a hubless native thread failing to
wake greenlets waiting on the semaphore's owning hub.
See :issue:`2013`.
- Stop the greenlets that ``communicate()`` spawned before
``gevent.subprocess.Popen.__exit__`` closes the child's pipes. Leaving the
``with`` block while one of them was still parked in a pipe, because an
exception was propagating or because the greenlet running the block was
killed, raised ``RuntimeError: reentrant call`` out of ``__exit__``. That
replaced the exception that was really unwinding, and skipped the ``wait()``
that reaps the child. A pipe some other greenlet is reading is now left alone
rather than raising, which is what ``communicate()`` already did.
See :issue:`2194`.

26.7.0

===================


Bugfixes
--------

- Fix ``repr()`` of a destroyed hub raising :exc:`AttributeError`.
``Hub.destroy()`` deleted the ``_resolver`` and ``_threadpool`` attributes
that ``Hub.__repr__`` reads; it now sets them to ``None``. This also fixes
``gevent.util.format_run_info()``, which renders any destroyed hub that is
still reachable.
See :issue:`2185`.
- Fix a hang at interpreter exit, on Python 3.13 and above, when a non-daemon
thread is waiting on a ``threading._register_atexit`` hook. The patched
``threading._shutdown`` joined those threads before running the hooks, the
reverse of the native order. This hung any program holding a live
:class:`concurrent.futures.ThreadPoolExecutor`, whose non-daemon workers stop
only when its ``_python_exit`` hook runs.
See :issue:`2188`.
- Make ``gevent.os.close`` not initialize a hub if one wasn't already present.
In that case, it can just directly close the file descriptor.



Deprecations and Removals
-------------------------

- In a future version (early 2027), ``gevent.monkey.patch_all`` will ONLY accept
keyword arguments. Currently, you could be calling it with positional
arguments, although that has never been the intent or documented way
to call it.



Misc
----

- Binary wheels for Python 3.15 are now built with 3.15b4. They may
not be compatible with older or newer versions of Python. Likewise,
binary wheels built by previous gevent releases may not be
compatible with 3.15b4 or newer.

26.5.0

===================


Features
--------

- Build and publish Windows 11 ARM wheels.
See :issue:`2172`.
- Add preliminary support for Python 3.15b1 and distribute binary wheels
for it.

Deprecations and Removals
-------------------------

Support for Python 3.10 will be ending soon. Support for PyPy will be
ending soon.

26.4.0

===================


Bugfixes
--------

- Make ``gevent.ssl`` stop reusing exception instances, as this could
appear to cause a memory leak if there are many short reads or writes.
Reported by 사재혁.
See :issue:`2159`.
- Fix ``Greenlet.dead`` returning true for an active greenlet during
early bootstrap. Thanks to Taegyun Kim.
See :issue:`2166`.
- Fix some potential GIL-related crashes during interpreter shutdown by
avoiding acquiring the GIL in libev callbacks when the interpreter is
finalizing. Thanks to Thomas Kowalski.
See :issue:`2170`.


Deprecations and Removals
-------------------------

- Support for Python 3.9 has been removed.

Manylinux wheels are built with version 2_28, up from 2014.

25.9.1

===================


Features
--------

- gevent is now tested on PyPy 3.11 v7.3.20. Previously it was tested
with the now end-of-life PyPy 3.10 v7.3.17.



Bugfixes
--------

- Fix a ``TypeError`` in the C extensions when attempting to put items
into a full ``SimpleQueue.``

It is believed this problem started in version 25.4.1. On older
versions, using the environment variable ``PURE_PYTHON`` or
``GEVENT_PURE_PYTHON`` works around
See :issue:`2139`.

25.8.2

===================


Bugfixes
--------

- Make the ``queue`` attribute of ``gevent.queue.Queue`` objects
writable from Python when the C extension is in use. When
monkey-patched, this lets subclasses assign to it from their ``_init``
method. (Prior to 25.8.1 the ``_init`` method simply wasn't called.)
See :issue:`2136`.

25.8.1

===================


Features
--------

- gevent is now tested on the latest available versions of Python:
3.14rc1, 3.13.5, 3.12.11, 3.11.13, and 3.10.18.

We expect to remove support for Python 3.9 soon.



Bugfixes
--------

- Prevent an ``AssertionError`` (from ``AbstractLinkable``, such as
locks, events, etc) from being printed after ``os.fork`` under certain
conditions.

See also :issue:`2058`.
See :issue:`1895`.
- Avoid a rare ``AttributeError`` that could occur during circular
garbage collection.
See :issue:`1961`.
- Update c-ares from 1.33.1 to 1.34.5.

This contains `a bug fix <https://github.com/c-ares/c-ares/pull/974>`_
resolving excess CPU usage for certain platforms.
See :issue:`2084`.
- Fix several possible interpreter crashes when there are race
conditions or programmers don't follow the documented rules and close
open files while they are still in use by other components.

For example, :meth:`selectors.BaseSelector.unregister` says "A file
object shall be unregistered prior to being closed." Failure to do so
is implementation dependent; in gevent, with libev compiled with
debugging enabled, this would crash the process, and with libuv,
an unexpected, uncatchable exception would be raised. Now, more common
failure scenarios are handled gracefully.

This also means that gevent now monkey-patches :func:`os.close` (on
POSIX) to help handle these cases.
See :issue:`2100`.
- Fix some ignored AssertionErrors after forking on older versions of
Python.
See :issue:`2111`.
- Fix ``AttributeError`` for ``_handle`` on v3.13.5+.
See :issue:`2119`.
- Make the classes in ``gevent.queue`` more compatible with classes that
expect to subclass the standard library queue classes.
See :issue:`2114`.
- Provide ``gevent.signal.set_wakeup_fd`` (monkey-patched by default) to
allow waking up on ``SIGCHLD``. Previously, gevent's internal handling
of ``SIGCHLD`` prevented this from working.
See :issue:`2126`.

25.5.1

===================


Features
--------

- Update the bundled libuv to 1.51 from 1.44.2.

Note that this changes the minimum supported versions of various
operating systems. Linux now requires kernel 3.10 and glibc 2.17, up
from 2.6.32 and glibc 2.12; macOS now requires version 11, up from
version 10.15; Windows now requires Windows 10 and Visual Studio 2017,
up from Windows 8 and VS 2015; finally, FreeBSD now requires version
12, up from version 10.

The musl Linux wheels are now built with muslinux_1_2 instead of
musllinux_1_1.
See :issue:`2108`.
- Add support for Cython 3.1 on Windows.

- Add support for Python 3.14b1 and significantly expand the set of
standard library tests we run with monkey-patching.

25.4.2

===================


Features
--------

- Make gevent's ``queue`` classes subscriptable to match the standard library.
See :issue:`2102`.
- Make the c-ares resolver build on Windows.

25.4.1

===================


Features
--------

- Add a new environment variable and configuration setting to control
whether blocking reports are printed by the monitor thread.
See :issue:`2070`.
- Add initial support for Python 3.14a7. Earlier and later versions of
Python 3.14 may or may not work as expected.



Bugfixes
--------

- Fix using gevent's BackdoorServer with Unix sockets.
See :issue:`1769`.
- Monkey-patching the ``queue`` module (done by default in
``patch_all``) now patches ``Queue``, ``PriorityQueue``, and
``LifoQueue``. In addition to the general benefits of making all those
classes cooperative, this is known to solve a non-deterministic
deadlock with ``urllib3``.

In addition, ``Queue`` was renamed to ``SimpleQueue``; previously
``SimpleQueue`` was an alias for the undocumented
``queue._PySimpleQueue``. This makes ``SimpleQueue`` cooperative even
without monkey-patching.

Likewise, ``JoinableQueue`` was renamed to ``Queue``, providing the
``join`` method to all ``Queue`` objects, thus matching the standard
library. The old name remains for backwards compatibility.
See :issue:`1957`.

.. caution::
  Only the documented, tested (by the standard library), attributes are identical between
  the standard library and gevent ``Queue`` implementations.
  Internal implementation details are very different, and using
  undocumented, untested details such as the internal ``Condition``
  object ``all_tasks_done`` instead of the documented, tested
  ``join`` method will fail with this change.

  If you have code that relies on undocumented implementation
  details that cannot bo ported to the documented interface, please
  file an issue.


- Do not assume that ``threading.get_native_id`` exists. This improves
support for untested platforms.
See :issue:`2053`.
- Do not use pywsgi in a security-conscious environment.

Fix one security issue related to HTTP 100 Continue handling.
See :issue:`2075`.

24.11.1

====================


Bugfixes
--------

- Remove some legacy code that supported Python 2 for compatibility with
the upcoming releases of Cython 3.1.

Also, the ``PeriodicMonitorThreadStartedEvent`` now properly
implements the ``IPeriodicMonitorThreadStartedEvent`` interface.
The ``EventLoopBlocked`` event includes the hub which was blocked,
and it is notified before the report is printed so that event
listeners can modify the report.
See :issue:`2076`.

24.10.3

====================


Bugfixes
--------

- Fix clearing stack frames on Python 3.13. This is invoked when you
fork after having used the thread pool.
See :issue:`2067`.
- Distribute manylinux2014 wheels for x86_64.
See :issue:`2068`.
- Stop switching to the hub in the after fork hook in a child process. This could lead to strange behaviour, and is different than what all other versions of Python do.

24.10.2

====================


Bugfixes
--------

- Workaround a Cython bug compiling on GCC14.
See :issue:`2049`.

24.10.1

====================


Features
--------

- Update the bundled c-ares to 1.33.1.

- Add support for Python 3.13.

- The functions and classes in ``gevent.subprocess`` no longer accept
 ``stdout=STDOUT`` and raise a ``ValueError``.

Several additions and changes to the ``queue`` module, including:

- ``Queue.shutdown`` is available on all versions of Python.
- ``LifoQueue`` is now a joinable queue.

- gevent.monkey changed from a module to a package. The public API
remains the same.

For this release, private APIs (undocumented, marked internal, or
beginning with an underscore) are also preserved. However, these may
be changed or removed at any time in the future. If you are using one
of these APIs and cannot replace it, please contact the gevent team.



Bugfixes
--------

- For platforms that don't have ``socketpair``, upgrade our fallback
code to avoid a security issue.
See :issue:`2048`.


Deprecations and Removals
-------------------------

- Remove support for Python 3.8, which has reached the end of its
support lifecycle.
See :issue:`remove_py38`.

24.2.1

===================


Bugfixes
--------

- Add support for Python patch releases 3.11.8 and 3.12.2, which changed
internal details of threading.

As a result of these changes, note that it is no longer possible to
change the ``__class__`` of a ``gevent.threading._DummyThread``
object on those versions.

See :issue:`2020`.

Other
-----

Other updates for compatibility with the standard library include:

- Errors raised from ``subprocess.Popen`` may not have a filename set.
- ``SSLSocket.recv_into`` and ``SSLSocket.read`` no longer require the
 buffer to implement ``len`` and now work with buffers whose size is
 not 1.
- gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close
 flaw.

In addition:

- Drop ``setuptools`` to a soft test dependency.
- Drop support for very old versions of CFFI.
- Update bundled c-ares from 1.19.1 to 1.26.0.
- Locks created by gevent, but acquired from multiple different
 threads (not recommended), no longer spin to implement timeouts
 and interruptible blocking. Instead, they use the native
 functionality of the Python 3 lock. This may improve some scenarios.
 See :issue:`2013`.

23.9.1

===================


Bugfixes
--------

- Require greenlet 3.0 on Python 3.11 and Python 3.12; greenlet 3.0 is
recommended for all platforms. This fixes a number of obscure crashes
on all versions of Python, as well as fixing a fairly common problem
on Python 3.11+ that could manifest as either a crash or as a
``SystemError``.
See :issue:`1985`.


----

23.9.0.post1

=========================

- Fix Windows wheel builds.
- Fix macOS wheel builds.

23.9.0

===================


Bugfixes
--------

- Make ``gevent.select.select`` accept arbitrary iterables, not just
sequences. That is, you can now pass in a generator of file
descriptors instead of a realized list. Internally, arbitrary
iterables are copied into lists. This better matches what the standard
library does. Thanks to David Salvisberg.
See :issue:`1979`.
- On Python 3.11 and newer, opt out of Cython's fast exception
manipulation, which *may* be causing problems in certain circumstances
when combined with greenlets.

On all versions of Python, adjust some error handling in the default
C-based loop. This fixes several assertion failures on debug versions
of CPython. Hopefully it has a positive impact under real conditions.
See :issue:`1985`.
- Make ``gevent.pywsgi`` comply more closely with the HTTP specification
for chunked transfer encoding. In particular, we are much stricter
about trailers, and trailers that are invalid (too long or featuring
disallowed characters) forcibly close the connection to the client
*after* the results have been sent.

Trailers otherwise continue to be ignored and are not available to the
WSGI application.

Previously, carefully crafted invalid trailers in chunked requests on
keep-alive connections might appear as two requests to
``gevent.pywsgi``. Because this was handled exactly as a normal
keep-alive connection with two requests, the WSGI application should
handle it normally. However, if you were counting on some upstream
server to filter incoming requests based on paths or header fields,
and the upstream server simply passed trailers through without
validating them, then this embedded second request would bypass those
checks. (If the upstream server validated that the trailers meet the
HTTP specification, this could not occur, because characters that are
required in an HTTP request, like a space, are not allowed in
trailers.) CVE-2023-41419 was reserved for this.

Our thanks to the original reporters, Keran Mu
(mkr22mails.tsinghua.edu.cn) and Jianjun Chen
(jianjuntsinghua.edu.cn), from Tsinghua University and Zhongguancun
Laboratory.
See :issue:`1989`.


----

23.7.0

===================


Features
--------

- Add preliminary support for Python 3.12, using greenlet 3.0a1. This
is somewhat tricky to build from source at this time, and there is
one known issue: On Python 3.12b3, dumping tracebacks of greenlets
is not available.
:issue:`1969`.
- Update the bundled c-ares version to 1.19.1.
See :issue:`1947`.


Bugfixes
--------

- Fix an edge case connecting a non-blocking ``SSLSocket`` that could result
in an AttributeError. In a change to match the standard library,
calling ``sock.connect_ex()`` on a subclass of ``socket`` no longer
calls the subclass's ``connect`` method.

Initial fix by Priyankar Jain.
See :issue:`1932`.
- Make gevent's ``FileObjectThread`` (mostly used on Windows) implement
``readinto`` cooperatively. PR by Kirill Smelkov.
See :issue:`1948`.
- Work around an ``AttributeError`` during cyclic garbage collection
when Python finalizers (``__del__`` and the like) attempt to use
gevent APIs. This is not a recommended practice, and it is unclear if
catching this ``AttributeError`` will fix any problems or just shift
them. (If we could determine the root situation that results in this
cycle, we might be able to solve it.)
See :issue:`1961`.


Deprecations and Removals
-------------------------

- Remove support for obsolete Python versions. This is everything prior
to 3.8.

Related changes include:

- Stop using ``pkg_resources`` to find entry points (plugins).
 Instead, use ``importlib.metadata``.
- Honor ``sys.unraisablehook`` when a callback function produces an
 exception, and handling the exception in the hub *also* produces an
 exception. In older versions, these would be simply printed.
- ``setup.py`` no longer includes the ``setup_requires`` keyword.
 Installation with a tool that understands ``pyproject.toml`` is
 recommended.
- The bundled tblib has been updated to version 2.0.


----

22.10.2

====================


Bugfixes
--------

- Update to greenlet 2.0. This fixes a deallocation issue that required
a change in greenlet's ABI. The design of greenlet 2.0 is intended to
prevent future fixes and enhancements from requiring an ABI change,
making it easier to update gevent and greenlet independently.

.. caution::

  greenlet 2.0 requires a modern-ish C++ compiler. This may mean
  certain older platforms are no longer supported.
  See :issue:`1909`.


----

22.10.1

====================


Features
--------

- Update bundled libuv to 1.44.2.
See :issue:`1913`.


Misc
----

- See :issue:`1898`., See :issue:`1910`., See :issue:`1915`.


----

22.08.0

====================


Features
--------

- Windows: Test and provide binary wheels for PyPy3.7.

Note that there may be issues with subprocesses, signals, and it may
be slow.
See :issue:`1798`.
- Upgrade embedded c-ares to 1.18.1.
See :issue:`1847`.
- Upgrade bundled libuv to 1.42.0 from 1.40.0.
See :issue:`1851`.
- Added preliminary support for Python 3.11 (rc2 and later).

Some platforms may or may not have binary wheels at this time.

.. important:: Support for legacy versions of Python, including 2.7
              and 3.6, will be ending soon. The
              maintenance burden has become too great and the
              maintainer's time is too limited.

              Ideally, there will be a release of gevent compatible
              with a final release of greenlet 2.0 that still
              supports those legacy versions, but that may not be
              possible; this may be the final release to support them.

:class:`gevent.threadpool.ThreadPool` can now optionally expire idle
threads. This is used by default in the implicit thread pool used for
DNS requests and other user-submitted tasks; other uses of a
thread-pool need to opt-in to this.
See :issue:`1867`.


Bugfixes
--------

- Truly disable the effects of compiling with ``-ffast-math``.
See :issue:`1864`.


----

21.12.0

====================


Features
--------

- Update autoconf files for Apple Silicon Macs. Note that while there
are reports of compiling gevent on Apple Silicon Macs now, this is
*not* a tested configuration. There may be some remaining issues with
CFFI on some systems as well.
See :issue:`1721`.
- Build and upload CPython 3.10 binary manylinux wheels.

Unfortunately, this required us to stop building and uploading CPython
2.7 binary manylinux wheels. Binary wheels for 2.7 continue to be
available for Windows and macOS.
See :issue:`1822`.
- Test and distribute musllinux_1_1 wheels.
See :issue:`1837`.
- Update the tested versions of PyPy2 and PyPy3. For PyPy2, there should
be no user visible changes, but for PyPy3, support has moved from
Python 3.6 to Python 3.7.
See :issue:`1843`.


Bugfixes
--------

- Try to avoid linking to two different Python runtime DLLs on Windows.
See :issue:`1814`.
- Stop compiling manylinux wheels with ``-ffast-math.`` This was
implicit in ``-Ofast``, but could alter the global state of the
process. Analysis and fix thanks to Ilya Konstantinov.
See :issue:`1820`.
- Fix hanging the interpreter on shutdown if gevent monkey patching
occurred on a non-main thread in Python 3.9.8 and above. (Note that
this is not a recommended practice.)
See :issue:`1839`.


----

21.8.0

===================


Features
--------

- Update the embedded c-ares from 1.16.1 to 1.17.1.
See :issue:`1758`.
- Add support for Python 3.10rc1 and newer.

As part of this, the minimum required greenlet version was increased
to 1.1.0 (on CPython), and the minimum version of Cython needed to
build gevent from a source checkout is 3.0a9.

Note that the dnspython resolver is not available on Python 3.10.
See :issue:`1790`.
- Update from Cython 3.0a6 to 3.0a9.
See :issue:`1801`.


Misc
----

- See :issue:`1789`.


----
Links

Update sqlalchemy from 2.0.52 to 2.0.52.

Changelog

2.0.52

:released: August 11, 2026

 .. change::
     :tags: bug, postgresql, reflection
     :tickets: 13157

     Fixed reflection of PostgreSQL CHECK constraints where an expression made
     up of multiple parenthesized sub-expressions, such as ``(x IS NULL OR y IS
     NULL) AND (x IS NULL OR y IS NULL)``, would have its leading and trailing
     parentheses incorrectly stripped, producing an unbalanced and
     syntactically invalid reflected expression.  Pull request courtesy
     Shaurya Singh.

 .. change::
     :tags: bug, mssql
     :tickets: 13380

     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.

 .. change::
   :tags: bug, orm declarative
   :tickets: 13386

   Fixed issue where using :pep:`593` ``Annotated`` wrapping a :pep:`695`
   ``type`` alias, such as ``Annotated[SomeTypeAlias, mapped_column()]``,
   would crash with ``AttributeError: __value__``. The internal
   ``is_pep695()`` check incorrectly identified the ``Annotated`` type as a
   PEP 695 type alias due to a quirk in ``Annotated.__origin__`` returning
   the first type argument rather than ``Annotated`` itself.

 .. change::
     :tags: bug, tests
     :tickets: 13392

     Fixed class-scoped pytest fixtures that were defined as instance methods
     using ``self``, which is deprecated as of pytest 9.1 and will be removed in
     pytest 10. Fixtures are now decorated with a compatibility ``classmethod``
     decorator and use ``cls`` as the first parameter.

 .. change::
     :tags: bug, sql
     :tickets: 13396

     Fixed issue where :meth:`_sql.Select.get_final_froms` would emit a
     deprecation warning when the statement made use of the PostgreSQL-specific
     expression argument to :meth:`_sql.Select.distinct`; the same spurious
     warning would be emitted when stringifying such a statement without
     explicitly using a PostgreSQL dialect.  The fix ensures that this 1.4-era
     warning is suppressed under both 2.0 and 2.1.

     Note that under SQLAlchemy 2.1, passing an expression to
     :meth:`_sql.Select.distinct` is deprecated overall, and is replaced by a
     new PostgreSQL-specific construct (see :ticket:`12342`).

 .. change::
     :tags: bug, sqlite
     :tickets: 13419

     Reworked the regular expression that detects inline ``UNIQUE`` column
     constraints during SQLite ``CREATE TABLE`` reflection so that the
     whitespace separating a column's type from a following clause is matched
     unambiguously.  The previous pattern had three overlapping quantifiers
     that could each consume a space character, so a column definition
     carrying a long run of whitespace in the stored schema made
     :meth:`_reflection.Inspector.get_unique_constraints` spend cubic time
     backtracking before returning.  Fix courtesy of Javid Khan.

 .. change::
     :tags: bug, sql
     :tickets: 13424

     Fixed an issue in :class:`.Numeric` where the
     :paramref:`.Numeric.decimal_return_scale` parameter was ignored when the
     DBAPI does not support native decimal objects (i.e.
     ``dialect.supports_native_decimal`` is ``False``).  In this path the result
     processor was computing the conversion scale from
     :paramref:`.Numeric.scale` directly, bypassing
     :paramref:`.Numeric.decimal_return_scale` entirely.  The behavior now
     matches :class:`.Float`, which already used the correct
     ``_effective_decimal_return_scale`` property. Pull request courtesy Kadir
     Can Ozden.

 .. change::
     :tags: bug, postgresql
     :tickets: 13429

     Fixed bug in the PostgreSQL dialect where a single quote in a sequence,
     table, or schema name, such as one supplied via a ``schema_translate_map``
     or an explicit :class:`.Sequence`, could result in a malformed
     ``nextval()`` statement. The quote is now properly escaped. Pull request
     courtesy dxbjavid.

 .. change::
     :tags: bug, orm
     :tickets: 13439

     Fixed a result-column misalignment bug in ORM-enabled UPDATE statements
     where ``synchronize_session="fetch"`` is in use, either explicitly or
     because the statement uses constructs such as CTEs that implicitly select
     for it.  Columns in rows returned by ``.returning()`` could be returned
     under incorrect keys (e.g. ``row[SomeClass.a]`` returning the value of
     a different column), a problem most likely to manifest under concurrent
     workloads.  ORM DELETE statements were not affected.

 .. change::
     :tags: bug, sql
     :tickets: 13448

     Added auditing to the test suite which exercises the literal execute
     processors across all datatypes and dialects to ensure that string input is
     either appropriately rejected or correctly escaped.  Literal execute
     processors are invoked when the :paramref:`.bindparam.literal_execute`
     parameter is used with an explicit :func:`.bindparam` object, which
     overrides DBAPI-native bind handling to render the value inline with the
     statement instead. Datatypes that were updated include the originally
     reported SQL Server ``Uuid`` / ``UNIQUEIDENTIFIER`` rendering which now
     escapes properly, the :class:`.JSONPATH` type that's currently
     PostgreSQL-only, and a full family of numeric types stemming from the
     :class:`_types.Float` and :class:`_types.Numeric` bases which now coerce
     the value to a number, rejecting non-numeric input.  Thanks to Javid Khan
     for helping to identify the issue.

 .. change::
     :tags: bug, platform
     :tickets: 13477

     Python 3.15 support has been added and tested, including minimal changes
     for full compatibility.

 .. change::
     :tags: bug, schema
     :tickets: 13481

     Fixed an issue where :meth:`_schema.Table.to_metadata` reused column
     default and on-update objects, causing the defaults on the original
     columns to refer to the copied columns. Default generators, including
     sequences, and server-side defaults are now copied and remain associated
     with their respective columns and metadata collections. Applications that
     inspected these objects will now see distinct defaults on the copied table
     instead of the objects owned by the original table.  Pull request courtesy
     Goutam Adwant.

 .. change::
     :tags: bug, orm
     :tickets: 13485

     Fixed bug where a failed :meth:`_orm.Session.bulk_insert_mappings`,
     :meth:`_orm.Session.bulk_update_mappings` or
     :meth:`_orm.Session.bulk_save_objects` call could leave the
     :class:`_orm.Session` permanently in a "flushing" state, such as when the
     transaction could not be begun because a previous flush had left it
     needing a rollback.  Unlike :meth:`_orm.Session.flush`, the bulk methods
     set the internal flushing flag and began the transaction outside of the
     ``try``/``finally`` block that resets it, so that neither
     :meth:`_orm.Session.rollback` nor :meth:`_orm.Session.close` would clear
     it, and every subsequent flush would raise ``InvalidRequestError: Session
     is already flushing``.  Pull request courtesy Hamody We.

 .. change::
     :tags: bug, orm
     :tickets: 13493

     Fixed issue where unpickling an ORM object that were loaded using loader
     options making use of wildcard tokens, such as :func:`_orm.load_only` or
     :func:`_orm.raiseload` with ``"*"``, would fail with ``KeyError`` or
     ``IndexError`` if the process doing the unpickling had not yet constructed
     a loader path making use of that same token.  This would typically be
     observed when the object were unpickled in a separate process, such as
     with the ``spawn`` or ``forkserver`` multiprocessing start methods, the
     latter of which became the default on POSIX platforms as of Python 3.14.
     The internal collection of these tokens is now established up front, so
     that it is identical in every process.

 .. change::
     :tags: bug, orm
     :tickets: 13493

     Fixed issue where a string ending in ``"*"`` passed to a
     :class:`_orm.Load` strategy method, such as
     ``Load(A).joinedload("bs.*")``, would bypass the check which rejects
     string attribute names in loader options, silently producing a loader
     path that matched nothing.  Such a string now raises
     :class:`.ArgumentError` with the same message given for any other
     string attribute name.  The bare wildcard ``"*"``, as in
     ``Load(A).lazyload("*")``, continues to be accepted.

 .. change::
     :tags: bug, orm
     :tickets: 6274

     Calling :func:`_orm.aliased` against a :func:`_sql.select` or
     :func:`_sql.union` / :class:`_sql.CompoundSelect` construct, which
     previously failed with an obscure ``AttributeError`` regarding a missing
     ``.mapper`` attribute, now raises when using SQLAlchemy 2.1, and emits a
     deprecation warning under SQLAlchemy 2.0 as it coerces the construct into a
     subquery instead.  This matches the behavior of other similar implicit
     SELECT-to-FROM coercions.  Pull request courtesy Rens Groothuijsen.

.. changelog::

2.0.51

:released: June 15, 2026

 .. change::
     :tags: bug, sql
     :tickets: 10827

     Fixed issue where :class:`_sql.StatementLambdaElement` would proxy
     attribute access through the cached "expected" expression rather than the
     resolved expression, causing stale closure-bound parameter values to be
     used when a lambda statement was extended with non-lambda criteria such as
     an additional ``.where()`` clause.  Courtesy cjc0013.

 .. change::
     :tags: bug, orm
     :tickets: 13207

     Fixed issue where :func:`_orm.subqueryload` combined with
     :meth:`.PropComparator.of_type` and :meth:`.PropComparator.and_` would
     silently drop the additional filter criteria, causing all related objects
     to be loaded instead of only those matching the filter.  The
     :class:`.LoaderCriteriaOption` was being constructed against the base
     entity rather than the effective entity indicated by
     :meth:`.PropComparator.of_type`.  Pull request courtesy Arya Rizky.

 .. change::
     :tags: bug, postgresql
     :tickets: 13355

     Repaired bug introduced in :ticket:`13229` where a two-phase
     transaction recovery would not return the correct transaction
     identifier when generating the identifiers using the ``xid()``
     method of the psycopg connection.

 .. change::
     :tags: bug, orm
     :tickets: 13356

     Fixed bug where a failure during ``tpc_prepare()`` within
     :meth:`_orm.Session.commit` for a two-phase session would raise
     :class:`.IllegalStateChangeError` instead of the original database
     exception.  The internal ``_prepare_impl()`` method's error handler
     was unable to invoke :meth:`_orm.SessionTransaction.rollback` due
     to a state-change guard, preventing proper cleanup and masking the
     underlying error.

 .. change::
     :tags: bug, postgresql
     :tickets: 13370

     Fixed regular expression in the pure Python hstore result processor,
     used when ``use_native_hstore=False`` is set, which could hang on
     malformed hstore text containing unterminated quoted segments with
     backslashes.  Pull request courtesy dxbjavid.

 .. change::
     :tags: bug, engine
     :tickets: 9427

     Fixed issue where :meth:`.Result.freeze` would lose track of ambiguous
     column names present in the original :class:`.CursorResult`, causing
     key-based access on the thawed result to silently return a value instead of
     raising :class:`.InvalidRequestError`.  The
     :class:`.SimpleResultMetaData` now accepts and propagates ambiguous key
     information so that frozen, thawed, and pickled results raise consistently
     for duplicate column names.  Pull request courtesy Saurabh Kohli.

.. changelog::

2.0.50

:released: May 24, 2026

 .. change::
     :tags: bug, sql
     :tickets: 10528

     Fixed issue where floor division (``//``) between a :class:`.Float` or
     :class:`.Numeric` numerator and an :class:`.Integer` denominator would omit
     the ``FLOOR()`` SQL wrapper on dialects where
     :attr:`.Dialect.div_is_floordiv` is ``True`` (the default, including
     PostgreSQL and SQLite).  ``FLOOR()`` is now applied if either the
     denominator or the numerator is a non-integer, so that expressions such as
     ``float_col // int_col`` render as ``FLOOR(float_col / int_col)`` instead
     of the incorrect ``float_col / int_col``.  Pull request courtesy r266-tech.

 .. change::
     :tags: bug, orm
     :tickets: 13203

     Fixed issue where using :func:`_orm.joinedload` with
     :meth:`.PropComparator.of_type` targeting a joined-table subclass combined
     with :meth:`.PropComparator.and_` referencing a column on that subclass
     would generate invalid SQL, where the subclass column was not adapted to
     the subquery alias.  Pull request courtesy Joaquin Hui Gomez.

 .. change::
     :tags: postgresql, bug
     :tickets: 13229

     Improve handling of two phase transaction identifiers for PostgreSQL
     when the identifier is provided by the user.
     As part of this change the psycopg dialect was updated to use the DBAPI
     two phase transaction API instead of executing the SQL directly.

 .. change::
     :tags: bug, sqlite
     :tickets: 13230

     Escape key and pragma values when utilizing the pysqlcipher dialect.

 .. change::
     :tags: bug, postgresql
     :tickets: 13241

     Fixed issue where the asyncpg driver could throw an insufficiently-handled
     exception ``InternalClientError`` under some circumstances, leading to
     connections not being properly marked as invalidated.



 .. change::
     :tags: bug, mysql, reflection
     :tickets: 13243

     Narrowed the scope of the internal workaround for MySQL bugs `88718
     <https://bugs.mysql.com/bug.php?id=88718>`_ and `#96365
     <https://bugs.mysql.com/bug.php?id=96365>`_ so that it is only applied
     where needed: MySQL 8.0.1 through 8.0.13 (where bug 88718 is present), and
     on systems with ``lower_case_table_names=2`` (where bug 96365 applies,
     typically macOS).  Previously the workaround was applied unconditionally
     for all MySQL 8.0+ versions, which caused a ``KeyError`` during foreign key
     reflection when the database user lacked SELECT privileges on referred
     tables.

 .. change::
     :tags: bug, orm
     :tickets: 13301

     Fixed issue where the presence of a :meth:`.SessionEvents.do_orm_execute`
     event hook would cause internal execution options such as ``yield_per`` and
     loader-specific state from the first ``orm_pre_session_exec`` pass to leak
     into the second pass, leading to errors when using relationship loaders
     such as :func:`.selectinload` and :func:`.immediateload`.  The execution
     options passed to the second compilation pass are now based on the original
     options plus only the explicit updates made via
     :meth:`.ORMExecuteState.update_execution_options` within the event hook.


 .. change::
     :tags: bug, mysql
     :tickets: 13306

     Fixed issue in aiomysql and asyncmy dialects that appears as of using
     pymysql 1.2.0; the dialects were not properly taking into account logic
     that detects the argument signature of pymysql's ``ping()`` method which
     was added as part of :ticket:`10492`.




 .. change::
     :tags: bug, postgresql
     :tickets: 13317

     Fixed issue where the :class:`.ExcludeConstraint` construct did not
     correctly forward the :paramref:`.ExcludeConstraint.info` parameter to
     the superclass, causing user-defined metadata to be lost. Pull request
     courtesy Wiktor Byrka.


 .. change::
     :tags: bug, orm
     :tickets: 13319

     Fixed issue where using :func:`_orm.with_polymorphic` on a leaf class (a
     subclass with no further descendants) or a non-inherited class would fail
     with an ``AttributeError`` when used in an ORM statement, due to
     :func:`_orm.configure_mappers` not being triggered implicitly. The fix
     ensures that :class:`.AliasedInsp` participates in the ``_post_inspect``
     hook, triggering mapper configuration during ORM statement compilation.


.. changelog::

2.0.49

:released: April 3, 2026

 .. change::
     :tags: postgresql, bug
     :tickets: 10902

     Fixed regular expression used when reflecting foreign keys in PostgreSQL to
     support escaped quotes in table names.
     Pull request courtesy of Austin Graham

 .. change::
     :tags: bug, oracle
     :tickets: 13150

     Fixed issue in Oracle dialect where the :class:`_oracle.RAW` datatype would
     not reflect the length parameter.   Pull request courtesy Daniel Sullivan.


 .. change::
     :tags: usecase, mssql
     :tickets: 13152

     Enhanced the ``aioodbc`` dialect to expose the ``fast_executemany``
     attribute of the pyodbc cursor.   This allows the ``fast_executemany``
     parameter to work with the ``mssql+aioodbc`` dialect.   Pull request
     courtesy Georg Sieber.

 .. change::
     :tags: bug, typing
     :tickets: 13167

     Fixed a typing issue where the typed members of :data:`.func` would return
     the appropriate class of the same name, however this creates an issue for
     typecheckers such as Zuban and pyrefly that assume :pep:`749` style
     typechecking even if the file states that it's a :pep:`563` file; they see
     the returned name as indicating the method object and not the class object.
     These typecheckers are actually following along with an upcoming test
     harness that insists on :pep:`749` style name resolution for this case
     unconditionally.  Since :pep:`749` is the way of the future regardless,
     differently-named type aliases have been added for these return types.


 .. change::
     :tags: bug, orm
     :tickets: 13176

     Fixed issue where :meth:`_orm.Session.get` would bypass the identity map
     and emit unnecessary SQL when ``with_for_update=False`` was passed,
     rather than treating it equivalently to the default of ``None``.
     Pull request courtesy of Joshua Swanson.

 .. change::
     :tags: bug, mssql, reflection
     :tickets: 13181, 13182

     Fixed regression from version 2.0.42 caused by :ticket:`12654` where the
     updated column reflection query would receive SQL Server "type alias" names
     for special types such as ``sysname``, whereas previously the base name
     would be received (e.g. ``nvarchar`` for ``sysname``), leading to warnings
     that such types could not be reflected and resulting in :class:`.NullType`,
     rather than the expected :class:`_mssql.NVARCHAR` for a type like ``sysname``.
     The column reflection query now joins ``sys.types`` a second time to look
     up the base type when the user type name is not present in
     :attr:`.MSDialect.ischema_names`, and both names are checked in
     :attr:`.MSDialect.ischema_names` for a match. Pull request courtesy Carlos
     Serrano.

 .. change::
     :tags: mssql, usecase
     :tickets: 13185

     Remove warning for SQL Server dialect when a new version is detected.
     The warning was originally added more than 15 years ago due to an unexpected
     value returned when using an old version of FreeTDS.
     The assumption is that since then the issue has been resolved, so make the
     SQL Server dialect behave like the other ones that don't have an upper bound
     check on the version number.

 .. change::
     :tags: bug, orm
     :tickets: 13193

     Fixed issue where chained :func:`_orm.joinedload` options would not be
     applied correctly when the final relationship in the chain is declared on a
     base mapper and accessed through a subclass mapper in a
     :func:`_orm.with_polymorphic` query. The path registry now correctly
     computes the natural path when a property declared on a base class is
     accessed through a path containing a subclass mapper, ensuring the loader
     option can be located during query compilation.

 .. change::
     :tags: bug, orm, inheritance
     :tickets: 13202

     Fixed issue where using :meth:`_orm.Load.options` to apply a chained loader
     option such as :func:`_orm.joinedload` or :func:`_orm.selectinload` with
     :meth:`_orm.PropComparator.of_type` for a polymorphic relationship would
     not generate the necessary clauses for the polymorphic subclasses. The
     polymorphic loading strategy is now correctly propagated when using a call
     such as ``joinedload(A.b).options(joinedload(B.c.of_type(poly)))`` to match
     the behavior of direct chaining e.g.
     ``joinedload(A.b).joinedload(B.c.of_type(poly))``.

 .. change::
     :tags: bug, orm, inheritance
     :tickets: 13209

     Fixed issue where using chained loader options such as
     :func:`_orm.selectinload` after :func:`_orm.joinedload` with
     :meth:`_orm.PropComparator.of_type` for a polymorphic relationship would
     not properly apply the chained loader option. The loader option is now
     correctly applied when using a call such as
     ``joinedload(A.b.of_type(poly)).selectinload(poly.SubClass.c)`` to eagerly
     load related objects.

.. changelog::

2.0.48

:released: March 2, 2026

 .. change::
     :tags: bug, engine
     :tickets: 13144

     Fixed a critical issue in :class:`.Engine` where connections created in
     conjunction with the :meth:`.DialectEvents.do_connect` event listeners
     would receive shared, mutable collections for the connection arguments,
     leading to a variety of potential issues including unlimited growth of the
     argument list as well as elements within the parameter dictionary being
     shared among concurrent connection calls.  In particular this could impact
     do_connect routines making use of complex mutable authentication
     structures.

.. changelog::

2.0.47

:released: February 24, 2026

 .. change::
     :tags: bug, orm
     :tickets: 13104

     Fixed issue when using ORM mappings with Python 3.14's :pep:`649` feature
     that no longer requires "future annotations", where the ORM's introspection
     of the ``__init__`` method of mapped classes would fail if non-present
     identifiers in annotations were present.  The vendored ``getfullargspec()``
     method has been amended to use ``Format.FORWARDREF`` under Python 3.14 to
     prevent resolution of names that aren't present.


 .. change::
     :tags: bug, postgresql
     :tickets: 13105

     Fixed an issue in the PostgreSQL dialect where foreign key constraint
     reflection would incorrectly swap or fail to capture ``onupdate`` and
     ``ondelete`` values when these clauses appeared in a different order than
     expected in the constraint definition. This issue primarily affected
     PostgreSQL-compatible databases such as CockroachDB, which may return ``ON
     DELETE`` before ``ON UPDATE`` in the constraint definition string. The
     reflection logic now correctly parses both clauses regardless of their
     ordering.

 .. change::
     :tags: bug, postgresql
     :tickets: 13107

     Fixed issue in the :ref:`engine_insertmanyvalues` feature where using
     PostgreSQL's ``ON CONFLICT`` clause with
     :paramref:`_dml.Insert.returning.sort_by_parameter_order` enabled would
     generate invalid SQL when the insert used an implicit sentinel (server-side
     autoincrement primary key). The generated SQL would incorrectly declare a
     sentinel counter column in the ``imp_sen`` table alias without providing
     corresponding values in the ``VALUES`` clause, leading to a
     ``ProgrammingError`` indicating column count mismatch. The fix allows batch
     execution mode when ``embed_values_counter`` is active, as the embedded
     counter provides the ordering capability needed even with upsert behaviors,
     rather than unnecessarily downgrading to row-at-a-time execution.

 .. change::
     :tags: bug, postgresql
     :tickets: 13110

     Fixed issue where :meth:`_postgresql.Insert.on_conflict_do_update`
     parameters were not respecting compilation options such as
     ``literal_binds=True``.  Pull request courtesy Loïc Simon.


 .. change::
     :tags: bug, sqlite
     :tickets: 13110

     Fixed issue where :meth:`_sqlite.Insert.on_conflict_do_update`
     parameters were not respecting compilation options such as
     ``literal_binds=True``.  Pull request courtesy Loïc Simon.

 .. change::
     :tags: usecase, engine
     :tickets: 13116

     The connection object returned by :meth:`_engine.Engine.raw_connection`
     now supports the context manager protocol, automatically returning the
     connection to the pool when exiting the context.

 .. change::
     :tags: bug, postgresql
     :tickets: 13130

     Fixed issue where :meth:`_postgresql.Insert.on_conflict_do_update`
     using parametrized bound parameters in the ``set_`` clause would fail
     when used with executemany batching. For dialects that use the
     ``use_insertmanyvalues_wo_returning`` optimization (psycopg2),
     insertmanyvalues is now disabled when there is an ON CONFLICT clause.
     For cases with RETURNING, row-at-a-time mode is used when the SET
     clause contains parametrized bindparams (bindparams that receive
     values from the parameters dict), ensuring each row's parameters are
     correctly applied. ON CONFLICT statements using expressions like
     ``excluded.<column>`` continue to batch normally.


 .. change::
     :tags: bug, sqlite
     :tickets: 13130

     Fixed issue where :meth:`_sqlite.Insert.on_conflict_do_update`
     using parametrized bound parameters in the ``set_`` clause would fail
     when used with executemany batching. Row-at-a-time mode is now used
     for ON CONFLICT statements with RETURNING that contain parametrized
     bindparams, ensuring each row's parameters are correctly applied. ON
     CONFLICT statements using expressions like ``excluded.<column>``
     continue to batch normally.

 .. change::
     :tags: bug, mysql
     :tickets: 13134

     Fixed issue where DDL compilation options were registered to the hard-coded
     dialect name ``mysql``. This made it awkward for MySQL-derived dialects
     like MariaDB, StarRocks, etc. to work with such options when different sets
     of options exist for different platforms. Options are now registered under
     the actual dialect name, and a fallback was added to help avoid errors when
     an option does not exist for that dialect.

     To maintain backwards compatibility, when using the MariaDB dialect with
     the options ``mysql_with_parser`` or ``mysql_using`` without also specifying
     the corresponding ``mariadb_`` prefixed options, a deprecation warning will
     be emitted. The ``mysql_`` prefixed options will continue to work during
     the deprecation period. Users should update their code to additionally
     specify ``mariadb_with_parser`` and ``mariadb_using`` when using the
     ``mariadb://`` dialect, or specify both options to support both dialects.

     Pull request courtesy Tiansu Yu.

.. changelog::

2.0.46

:released: January 21, 2026

 .. change::
     :tags: bug, sqlite
     :tickets: 13039

     Fixed issue in the aiosqlite driver where SQLAlchemy's setting of
     aiosqlite's worker thread to "daemon" stopped working because the aiosqlite
     architecture moved the location of the worker thread in version 0.22.0.
     This "daemon" flag is necessary so that a program is able to exit if the
     SQLite connection itself was not explicitly closed, which is particularly
     likely with SQLAlchemy as it maintains SQLite connections in a connection
     pool.  While it's perfectly fine to call :meth:`.AsyncEngine.dispose`
     before program exit, this is not historically or technically necessary for
     any driver of any known backend, since a primary feature of relational
     databases is durability.  The change also implements support for
     "terminate" with aiosqlite when using version version 0.22.1 or greater,
     which implements a sync ``.stop()`` method.

 .. change::
     :tags: usecase, mssql
     :tickets: 13045

     Added support for the ``IF EXISTS`` clause when dropping indexes on SQL
     Server 2016 (13.x) and later versions. The :paramref:`.DropIndex.if_exists`
     parameter is now honored by the SQL Server dialect, allowing conditional
     index drops that will not raise an error if the index does not exist.
     Pull request courtesy Edgar Ramírez Mondragón.

 .. change::
     :tags: bug, postgresql
     :tickets: 13059

     Fixed issue where PostgreSQL JSONB operators
     :meth:`_postgresql.JSONB.Comparator.path_match` and
     :meth:`_postgresql.JSONB.Comparator.path_exists` were applying incorrect
     ``VARCHAR`` casts to the right-hand side operand when used with newer
     PostgreSQL drivers such as psycopg. The operators now indicate the
     right-hand type as ``JSONPATH``, which currently results in no casting
     taking place, but is also compatible with explicit casts if the
     implementation were require it at a later point.



 .. change::
     :tags: bug, postgresql
     :tickets: 13067

     Fixed regression in PostgreSQL dialect where JSONB subscription syntax
     would generate incorrect SQL for :func:`.cast` expressions returning JSONB,
     causing syntax errors. The dialect now properly wraps cast expressions in
     parentheses when using the ``[]`` subscription syntax, generating
     ``(CAST(...))[index]`` instead of ``CAST(...)[index]`` to comply with
     PostgreSQL syntax requirements. This extends the fix from :ticket:`12778`
     which addressed the same issue for function calls.

 .. change::
     :tags: bug, mariadb
     :tickets: 13070

     Fixed the SQL compilation for the mariadb sequence "NOCYCLE" keyword that
     is to be emitted when the :paramref:`.Sequence.cycle` parameter is set to
     False on a :class:`.Sequence`.  Pull request courtesy Diego Dupin.

 .. change::
     :tags: bug, typing
     :tickets: 13075

     Fixed typing issues where ORM mapped classes and aliased entities could not
     be used as keys in result row mappings or as join targets in select
     statements. Patterns such as ``row._mapping[User]``,
     ``row._mapping[aliased(User)]``, ``row._mapping[with_polymorphic(...)]``
     (rejected by both mypy and Pylance), and ``.join(aliased(User))``
     (rejected by Pylance) are documented and fully supported at runtime but
     were previously rejected by type checkers. The type definitions for
     :class:`._KeyType` and :class:`._FromClauseArgument` have been updated to
     accept these ORM entity types.

 .. change::
     :tags: bug, postgresql

     Improved the foreign key reflection regular expression pattern used by the
     PostgreSQL dialect to be more permissive in matching identifier characters,
     allowing it to correctly handle unicode characters in table and column
     names. This change improves compatibility with PostgreSQL variants such as
     CockroachDB that may use different quoting patterns in combination with
     unicode characters in their identifiers.  Pull request courtesy Gord
     Thompson.

.. changelog::

2.0.45

:released: December 9, 2025

 .. change::
     :tags: bug, typing
     :tickets: 12730

     Fixed typing issue where :meth:`.Select.with_for_update` would not support
     lists of ORM entities or other FROM clauses in the
     :paramref:`.Select.with_for_update.of` parameter. Pull request courtesy
     Shamil.

 .. change::
     :tags: bug, orm
     :tickets: 12858

     Fixed issue where calling :meth:`.Mapper.add_property` within mapper event
     hooks such as :meth:`.MapperEvents.instrument_class`,
     :meth:`.MapperEvents.after_mapper_constructed`, or
     :meth:`.MapperEvents.before_mapper_configured` would raise an
     ``AttributeError`` because the mapper's internal property collections were
     not yet initialized. The :meth:`.Mapper.add_property` method now handles
     early-stage property additions correctly, allowing properties including
     column properties, deferred columns, and relationships to be added during
     mapper initialization events.  Pull request courtesy G Allajmi.

 .. change::
     :tags: bug, postgresql
     :tickets: 12867

     Fixed issue where PostgreSQL dialect options such as ``postgresql_include``
     on :class:`.PrimaryKeyConstraint` and :class:`.UniqueConstraint` were
     rendered in the wrong position when combined with constraint deferrability
     options like ``deferrable=True``. Pull request courtesy G Allajmi.

 .. change::
     :tags: bug, sql
     :tickets: 12915

     Some improvements to the :meth:`_sql.ClauseElement.params` method to
     replace bound parameters in a query were made, however the ultimate issue
     in :ticket:`12915` involving ORM :func:`_orm.aliased` cannot be fixed fully
     until 2.1, where the method is being rewritten to work without relying on
     Core cloned traversal.

 .. change::
     :tags: bug, sqlite, reflection
     :tickets: 12924

     A series of improvements have been made for reflection of CHECK constraints
     on SQLite. The reflection logic now correctly handles table names
     containing the strings "CHECK" or "CONSTRAINT", properly supports all four
     SQLite identifier quoting styles (double quotes, single quotes, brackets,
     and backticks) for constraint names, and accurately parses CHECK constraint
     expressions containing parentheses within string literals using balanced
     parenthesis matching with string context tracking.    Big thanks to
     GruzdevAV for new test cases and implementation ideas.

 .. change::
     :tags: bug, orm
     :tickets: 12952

     Fixed issue in Python 3.14 where dataclass transformation would fail when
     a mapped class using :class:`.MappedAsDataclass` included a
     :func:`.relationship` referencing a class that was not available at
     runtime (e.g., within a ``TYPE_CHECKING`` block). This occurred when using
     Python 3.14's :pep:`649` deferred annotations feature, which is the
     default behavior without a ``from __future__ import annotations``
     directive.

 .. change::
     :tags: bug, sqlite
     :tickets: 12954

     Fixed issue where SQLite dialect would fail to reflect constraint names
     that contained uppercase letters or other characters requiring quoting. The
     regular expressions used to parse primary key, foreign key, and unique
     constraint names from the ``CREATE TABLE`` statement have been updated to
     properly handle both quoted and unquoted constraint names.

 .. change::
     :tags: bug, typing

     Fixed typing issue where :class:`.coalesce` would not return the correct
     return type when a nullable form of that argument were passed, even though
     this function is meant to select the non-null entry among possibly null
     arguments.  Pull request courtesy Yannick PÉROUX.


 .. change::
     :tags: usecase, mysql
     :tickets: 12964

     Added support for MySQL 8.0.1 + ``FOR SHARE`` to be emitted for the
     :meth:`.Select.with_for_update` method, which offers compatibility with
     ``NOWAIT`` and ``SKIP LOCKED``.  The new syntax is used only for MySQL when
     version 8.0.1 or higher is detected. Pull request courtesy JetDrag.

 .. change::
     :tags: bug, sql
     :tickets: 12987

     Fixed issue where using the :meth:`.ColumnOperators.in_` operator with a
     nested :class:`.CompoundSelect` statement (e.g. an ``INTERSECT`` of
     ``UNION`` queries) would raise a :class:`NotImplementedError` when the
     nested compound select was the first argument to the outer compound select.
     The ``_scalar_type()`` internal method now properly handles nested compound
     selects.

 .. change::
     :tags: bug, postgresql
     :tickets: 13015

     Fixed the structure of the SQL string used for the
     :ref:`engine_insertmanyvalues` feature when an explicit sequence with
     ``nextval()`` is used. The SQL function invocation for the sequence has
     been moved from being rendered inline within each tuple inside of VALUES to
     being rendered once in the SELECT that reads from VALUES. This change
     ensures the function is invoked in the correct order as rows are processed,
     rather than assuming PostgreSQL will execute inline function calls within
     VALUES in a particular order. While current PostgreSQL versions appear to
     handle the previous approach correctly, the database does not guarantee
     this behavior for future versions.

 .. change::
     :tags: usecase, postgresql
     :tickets: 6511

     Added support for reflection of collation in types for PostgreSQL.
     The ``collation`` will be set only if different from the default
     one for the type.
     Pull request courtesy Denis Laxalde.

 .. change::
     :tags: bug, examples

     Fixed the "short_selects" performance example where the cache was being
     used in all the examples, making it impossible to compare performance with
     and without the cache.   Less important comparisons like "lambdas" and
     "baked queries" have been removed.


 .. change::
     :tags: change, tests

     A noxfile.py has been added to allow testing with nox.  This is a direct
     port of 2.1's move to nox, however leaves the tox.ini file in place and
     retains all test documentation in terms of tox.   Version 2.1 will move to
     nox fully, including deprecation warnings for tox and new testing
     documentation.

.. changelog::

2.0.44

:released: October 10, 2025

 .. change::
     :tags: bug, sql
     :tickets: 12271

     Improved the implementation of :meth:`.UpdateBase.returning` to use more
     robust logic in setting up the ``.c`` collection of a derived statement
     such as a CTE.  This fixes issues related to RETURNING clauses that feature
     expressions based on returned columns with or without qualifying labels.

 .. change::
     :tags: usecase, asyncio
     :tickets: 12273

     Generalize the terminate logic employed by the asyncpg dialect to reuse
     it in the aiomysql and asyncmy dialect implementation.

 .. change::
     :tags: bug, mssql
     :tickets: 12798

     Improved the base implementation of the asyncio cursor such that it
     includes the option for the underlying driver's cursor to be actively
     closed in those cases where it requires ``await`` in order to complete the
     close sequence, rather than relying on garbage collection to "close" it,
     when a plain :class:`.Result` is returned that does not use ``await`` for
     any of its methods.  The previous approach of relying on gc was fine for
     MySQL and SQLite dialects but has caused problems with the aioodbc
     implementation on top of SQL Server.   The new option is enabled
     for those dialects which have an "awaitable" ``cursor.close()``, which
     includes the aioodbc, aiomysql, and asyncmy dialects (aiosqlite is also
     modified for 2.1 only).

 .. change::
     :tags: bug, ext
     :tickets: 12802

     Fixed issue caused by an unwanted functional change while typing
     the :class:`.MutableList` class.
     This change also reverts all other functional changes done in
     the same change.

 .. change::
     :tags: bug, typing
     :tickets:

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.

1 participant