]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Guard against KeyError in session.merge after check for identity
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Sep 2017 16:11:19 +0000 (12:11 -0400)
committermike bayer <mike_mp@zzzcomputing.com>
Mon, 4 Sep 2017 23:36:51 +0000 (19:36 -0400)
commit68953902dda9209ee72cde44d4802d730e4f75e3
treec0de4e91c97116d4006f47f063e81b4922d5186f
parent4be865f79beae79a027561c979286f1dc5bc3fc9
Guard against KeyError in session.merge after check for identity

Fixed bug in :meth:`.Session.merge` following along similar lines as that
of :ticket:`4030`, where an internal check for a target object in
the identity map could lead to an error if it were to be garbage collected
immediately before the merge routine actually retrieves the object.

Change-Id: Ifecfb8b9d50c52d0ebd5a03e1bd69fe3abf1dc40
Fixes: #4069
(cherry picked from commit bfad032017fde2e519ad5eacc0011a71bf7a22a9)
doc/build/changelog/unreleased_11/4069.rst [new file with mode: 0644]
lib/sqlalchemy/orm/session.py