title: Pickle data truncated
body: <p>While trying to send a list to a client process, I pickle it, but when I receive this on the client side it always gives me the error pickle data was truncated, and I don't know how to fix it.</p>
  <p>sv</p>
  <pre><code>def handle_client(connection):
      connection.send(str.encode('welcome to sv'))
      stock = random.sample(output, 1)
      order = pickle.dumps(stock)
      while True:
          data = connection.recv(2048)
          if not data:
              break
      if data.decode('utf-8') == 'wanna trade!':
          print(&quot;trade order received&quot;)
          tcp.send(order)
      reply = connection.recv(2048)
      if reply.decode('utf-8') == 'Y':
         tcp.send(order)
         output.remove(order)
      elif reply.decode('utf-8') == 'N':
          print(&quot;doesn't wish to buy.&quot;)
      connection.close()
  
  </code></pre>
  <p>client</p>
  <pre><code>while True:
      Cliente.send(str.encode('wanna trade!'))
      recv = Cliente.recv(2048)
      if not recv:
          break
      if recv:
          Response = pickle.loads(recv)
          print(Response)
          Check = input('Y/N: ')
          Cliente.send(str.encode(Check))
      recv2 = Cliente.recv(2048)
      if recv2:
          final = pickle.load(recv2)
          purchases.append(final.decode('utf-8'))
          print(purchases)
  Cliente.close()
  </code></pre>