title: 'NoneType' object has no attribute 'sendall' PYTHON
body: <p>My current python script:</p>
  
  <pre><code>import os
  import ftplib
  import hashlib
  import glob
  
  
  hashing = "123"
  m = hashlib.md5()
  m.update(hashing)
  dd = m.hexdigest()
  
  ftp = ftplib.FTP('localhost','kevin403','S$ip1234')
  ftp.cwd('/var/www/html/image')
  
  for image in glob.glob(os.path.join('Desktop/images/test*.png')):
    with open(image, 'rb') as file:
      ftp.storbinary('STOR '+dd+ '.png', file)
  
  ftp.close()
  ftp.quit()
  </code></pre>
  
  <p>Anybody know this error? I trying to send file over to another folder via ftp.</p>
  
  <p>The error i got when running the script:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/home/kevin403/wwq.py", line 21, in &lt;module&gt;
    ftp.quit()
  File "/usr/lib/python2.7/ftplib.py", line 591, in quit
    resp = self.voidcmd('QUIT')
  File "/usr/lib/python2.7/ftplib.py", line 253, in voidcmd
    self.putcmd(cmd)
  File "/usr/lib/python2.7/ftplib.py", line 181, in putcmd
    self.putline(line)
  File "/usr/lib/python2.7/ftplib.py", line 176, in putline
    self.sock.sendall(line)
  AttributeError: 'NoneType' object has no attribute 'sendall'
  </code></pre>