--- Lib/multiprocessing/connection.py.orig 2013-11-17 07:22:36.000000000 +0000 +++ Lib/multiprocessing/connection.py 2014-02-07 12:55:26.000000000 +0000 @@ -397,11 +397,12 @@ def _send_bytes(self, buf): # For wire compatibility with 3.2 and lower n = len(buf) - self._send(struct.pack("!i", n)) + payload = struct.pack("!i", n) # The condition is necessary to avoid "broken pipe" errors # when sending a 0-length buffer if the other end closed the pipe. if n > 0: - self._send(buf) + payload += buf + self._send(payload) def _recv_bytes(self, maxsize=None): buf = self._recv(4)