--- devel/lib/python3.3/asynchat.py 2013-04-02 16:00:06.153960467 +0200 +++ asynchat.py 2013-05-07 15:07:33.769541341 +0200 @@ -215,15 +215,12 @@ def initiate_send(self): while self.producer_fifo and self.connected: - first = self.producer_fifo[0] + first = self.producer_fifo.popleft() # handle empty string/buffer or None entry if not first: - del self.producer_fifo[0] if first is None: - ## print("first is None") self.handle_close() return - ## print("first is not None") # handle classic producer behavior obs = self.ac_out_buffer_size @@ -233,8 +230,6 @@ data = first.more() if data: self.producer_fifo.appendleft(data) - else: - del self.producer_fifo[0] continue if isinstance(data, str) and self.use_encoding: @@ -249,9 +244,7 @@ if num_sent: if num_sent < len(data) or obs < len(first): - self.producer_fifo[0] = first[num_sent:] - else: - del self.producer_fifo[0] + self.producer_fifo.appendleft(first[num_sent:]) # we tried to send some actual data return