Merge lp:~elachuni/wsgi-oops/dont-iterate-weakkeydicts into lp:wsgi-oops

Proposed by Anthony Lenton
Status: Merged
Approved by: Elliot Murphy
Approved revision: 50
Merged at revision: 51
Proposed branch: lp:~elachuni/wsgi-oops/dont-iterate-weakkeydicts
Merge into: lp:wsgi-oops
Diff against target: 13 lines (+2/-1)
1 file modified
canonical/oops/serializer.py (+2/-1)
To merge this branch: bzr merge lp:~elachuni/wsgi-oops/dont-iterate-weakkeydicts
Reviewer Review Type Date Requested Status
Elliot Murphy (community) Approve
Review via email: mp+24862@code.launchpad.net

Description of the change

Using iterators from weakkeydicts is not threadsafe, (see Python bug http://bugs.python.org/issue839159).

This branch avoids using these iterators, to fix bug #574399.

Thanks MenTaLguY for spotting the fix!

To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

Nice fix!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'canonical/oops/serializer.py'
2--- canonical/oops/serializer.py 2010-02-22 20:01:02 +0000
3+++ canonical/oops/serializer.py 2010-05-06 19:39:26 +0000
4@@ -164,7 +164,8 @@
5 # Key wasn't seen yet. Use the maximum sequence from all
6 # known serializers.
7 sequence = max(serializer.get_initial_sequence() for
8- serializer in self._serializers[self._key])
9+ serializer in
10+ self._serializers[self._key].keys())
11 else:
12 # That's the most common path by far, so even though this
13 # all sounds complex, the overhead isn't significant.

Subscribers

People subscribed via source and target branches