Closed
Description
Migrated issue, originally created by Anonymous
With Python 2.6.5 and SQLAlchemy 0.6, we have been getting occasional RuntimeErrors. Relevant portion of the traceback is as follows:
File "source", line 189, in insert_or_update
query.update(update_values)
File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/orm/query.py", line 1970, in update
for (cls, pk),obj in session.identity_map.iteritems():
File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/orm/identity.py", line 162, in iteritems
for state in dict.itervalues(self):
RuntimeError: dictionary changed size during iteration
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
sqlalchemy-bot commentedon Aug 25, 2010
Michael Bayer (@zzzeek) wrote:
here's a reproducer, though in your case its almost certainly async gc causing it:
sqlalchemy-bot commentedon Aug 25, 2010
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Aug 25, 2010
Michael Bayer (@zzzeek) wrote:
and here is a patch, but I need you to try it out for me, please...it would be very helpful to test this code out in a reproducing environment before committing.
sqlalchemy-bot commentedon Aug 25, 2010
Michael Bayer (@zzzeek) wrote:
I'll probably commit this revised version in any case. Needs tests, needs to be checked on 2to3 also since the items/values methods here were always thorny with py3k. Simpler though since we are giving up on having iterators in use.
sqlalchemy-bot commentedon Sep 7, 2010
Michael Bayer (@zzzeek) wrote:
OOOkkkkk, well that patch is in 177fdcb, thanks for the feedback ! ;)
sqlalchemy-bot commentedon Sep 7, 2010
Changes by Michael Bayer (@zzzeek):