[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mario, thanks for the bug report. -- status: open -> closed ___ Python tracker ___ ___ Python-bu

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 408f23b6cec5 by Raymond Hettinger in branch '3.1': Issue #11875: Alter the previous fix to work better with subclasses http://hg.python.org/cpython/rev/408f23b6cec5 New changeset 4e6840477d96 by Raymond Hettinger in branch '3.2': Issue #11875: Alte

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset db66eaf353a6 by Raymond Hettinger in branch '2.7': Issue #11875: Alter the previous fix to work better with subclasses http://hg.python.org/cpython/rev/db66eaf353a6 -- ___ Python tracker

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The call to self.__class__() can break subclasses of OrderedDict for two reasons: - The subclass constructor may have a different signature - Attributes set by the subclass.__init__ are removed from the pickle:: import collections, pickle class Mydict(c

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Mario Juric
Mario Juric added the comment: Hi Raymond, Excellent! Many thanks for such a quick fix, this has been bugging us for months! -- ___ Python tracker ___

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mario, I removed the unnecessary mutation, but remember that OrderedDict's are not thread-safe in general. Anything that updates an OrderedDict will temporarily leave it in an inconsistent state while the links and mappings are being updated. That bein

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 50a89739836f by Raymond Hettinger in branch '3.1': Issue 11875: Keep OrderedDict's __reduce__ from temporarily mutating the object. http://hg.python.org/cpython/rev/50a89739836f New changeset a7ac7a7c8c78 by Raymond Hettinger in branch '3.2': Issue

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3150b6939731 by Raymond Hettinger in branch '2.7': Issue 11875: Keep OrderedDict's __reduce__ from temporarily mutating the object. http://hg.python.org/cpython/rev/3150b6939731 -- nosy: +python-dev ___

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: To avoid hardcoding the mangled names: @@ -155,10 +155,9 @@ def __reduce__(self): 'Return state information for pickling' items = [[k, self[k]] for k in self] -tmp = self.__map, self.__root, self.__hardroot -del self.__

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue11875] OrderedDict.__reduce__ not threadsafe

2011-04-19 Thread Mario Juric
New submission from Mario Juric : The implementation of OrderedDict.__reduce__() in Python 2.7.1 is not thread safe because of the following four lines: tmp = self.__map, self.__root del self.__map, self.__root inst_dict = vars(self).copy() self.__map, self.__roo