]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Added a list() call around a weak dictionary used within the
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Apr 2015 20:55:58 +0000 (16:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Apr 2015 20:55:58 +0000 (16:55 -0400)
commit phase of the session, which without it could cause
a "dictionary changed size during iter" error if garbage collection
interacted within the process.   Change was introduced by

doc/build/changelog/changelog_10.rst
lib/sqlalchemy/orm/session.py

index 597c8adcd58bfec69dc7876bf661a4e5ce52d226..cf9ebc1a488d800bd4e260b8ab290343122752fe 100644 (file)
 .. changelog::
     :version: 1.0.0b5
 
+    .. change::
+        :tags: bug, orm
+
+        Added a list() call around a weak dictionary used within the
+        commit phase of the session, which without it could cause
+        a "dictionary changed size during iter" error if garbage collection
+        interacted within the process.   Change was introduced by
+        #3139.
+
     .. change::
         :tags: bug, postgresql
         :tickets: 3343
index bc9444040eeb39f391883dbad629cd9aaac1b1cc..f3ad2349c397711e0fc13e54b109930f48d4bf87 100644 (file)
@@ -300,7 +300,7 @@ class SessionTransaction(object):
         if not self.nested and self.session.expire_on_commit:
             for s in self.session.identity_map.all_states():
                 s._expire(s.dict, self.session.identity_map._modified)
-            for s in self._deleted:
+            for s in list(self._deleted):
                 s._detach()
             self._deleted.clear()
         elif self.nested: