I put a suggested fix in the bug report. as
On 9 Feb 2015, at 10:52 am, Barry Warsaw <ba...@list.org> wrote: On Feb 09, 2015, at 07:06 AM, Andrew Stuart wrote: > This appears to fix the problme in rest/users.py > > def on_delete(self, request, response): > """Delete the named user, all her memberships, and addresses.""" > if self._user is None: > not_found(response) > return > for member in self._user.memberships.members: > member.unsubscribe() > user_manager = getUtility(IUserManager) > addresses_for_deletion = [] > for address in self._user.addresses: > # to avoid mutating the self._user.addresses iterator, create a > separate list of addresses > addresses_for_deletion.append(address) > for address in addresses_for_deletion: > user_manager.delete_address(address) > user_manager.delete_user(self._user) > no_content(response) Thanks for tracking this down. I don't know whether this may have changed between Storm and SQLAlchemy, but it's very likely at least now caused by the old mutate-dictionary-while-iterating problem. With the switch to Python 3, if it were a dictionary an exception would have been thrown: Python 3.4.2 (default, Feb 3 2015, 14:26:38) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> d = dict(a=1, b=2, c=3, d=4) >>> for k in d: ... del d[k] ... Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: dictionary changed size during iteration >>> Thanks for opening the bug; I'll work up a test case and a fix, but I think you're in the right direction. Cheers, -Barry _______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org https://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-developers/andrew.stuart%40supercoders.com.au Security Policy: http://wiki.list.org/x/QIA9 _______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org https://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org Security Policy: http://wiki.list.org/x/QIA9