title: python 3.6 socket pickle data was truncated
body: <p>I can not send my numpy array in socket.  I use pickle but my client pickle crashes with this error: pickle data was truncated</p>
  <p>My server :
  I create a numpy array and I want to send in my client with pickle (it's work)</p>
  <pre><code>import socket, pickle
  import numpy as np
  from PIL import ImageGrab
  import cv2
  
  
  while(True):
      HOST = 'localhost'
      PORT = 50007
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      s.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 4096)
      s.bind((HOST, PORT))
      s.listen(1)
      conn, addr = s.accept()
      print ('Connected by', addr)
  
      arr = np.array([[0, 1], [2, 3]])
      printscreen_pil=ImageGrab.grab(bbox=(10,10,500,500))
      img = np.array(printscreen_pil) ## Transform to Array
      
      data_string = pickle.dumps(img)
      conn.send(data_string)
  
      msg_recu = conn.recv(4096)
      print(msg_recu.decode())
  
      conn.close()
  </code></pre>
  <p>My client
  He has my numpy array, but I can not load with pickle.  I have this error.</p>
  <pre><code>import socket, pickle
  import numpy as np
  
  HOST = 'localhost'
  PORT = 50007
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect((HOST, PORT))
  
  msg_a_envoyer = &quot;hello&quot;.encode()
  s.send(msg_a_envoyer)
  
  
  while 1:
      data = s.recv(4096)
      if not data: break
      data_arr = pickle.loads(data)
      print (data_arr)
  s.close()
  </code></pre>