This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jim.Jewett
Recipients Jim.Jewett
Date 2012-03-26.18:16:50
SpamBayes Score 2.5173816e-07
Marked as misclassified No
Message-id <1332785811.84.0.616508221107.issue14417@psf.upfronthosting.co.za>
In-reply-to
Content
Per the 3.3 WhatsNew:
"""issue 14205: A dict lookup now raises a RuntimeError if the dict is modified during the lookup. If you implement your own comparison function for objects used as dict keys and the dict is shared by multiple threads, access to the dict should be protected by a lock."""

This should be easier to do.  My suggestion would be that the change to (general) lookdict (or possibly an additional transition, if you want a less-slow path for non-string non-container builtins) create the lock, and acquire/release that lock.  At a minimum, there should be a dict subclass that does this.

[Note that this is arguably a regression, since previous python versions would just retry, which would be enough to protect innocent but unlucky code.]
History
Date User Action Args
2012-03-26 18:16:51Jim.Jewettsetrecipients: + Jim.Jewett
2012-03-26 18:16:51Jim.Jewettsetmessageid: <1332785811.84.0.616508221107.issue14417@psf.upfronthosting.co.za>
2012-03-26 18:16:51Jim.Jewettlinkissue14417 messages
2012-03-26 18:16:50Jim.Jewettcreate