From 1fa5c729b758776bbb2f45b422c33930444b2cf0 Mon Sep 17 00:00:00 2001
From: david-sarah <david-sarah@jacaranda.org>
Date: Sat, 24 Sep 2011 14:12:08 -0700
Subject: [PATCH] mutable/publish.py: copy the self.writers dict before
 iterating over it, since we remove elements from it during the iteration.
 refs #393

---
 src/allmydata/mutable/publish.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/allmydata/mutable/publish.py b/src/allmydata/mutable/publish.py
index a20ab15e..0eceedb1 100644
--- a/src/allmydata/mutable/publish.py
+++ b/src/allmydata/mutable/publish.py
@@ -861,10 +861,7 @@ class Publish:
         ds = []
         verification_key = self._pubkey.serialize()
 
-
-        # TODO: Bad, since we remove from this same dict. We need to
-        # make a copy, or just use a non-iterated value.
-        for (shnum, writer) in self.writers.iteritems():
+        for (shnum, writer) in self.writers.copy().iteritems():
             writer.put_verification_key(verification_key)
             self.num_outstanding += 1
             def _no_longer_outstanding(res):
-- 
2.45.2