title: IndexError: pop from empty list
body: <p>I need help. I have no idea why I am getting this error. The error is in <code>fname = 1st.pop()</code></p>
  
  <pre><code>for i in range(num) :
          fname = lst.pop()
          lTransfer   = [(os.path.join(src, fname),           os.path.join(dst, fname)),
                         (os.path.join(src, fname) + ".md5",  os.path.join(dst, fname) + ".md5")]
          for tFiles in lTransfer:
              #
              # copy the file
              #
              try :
                  shutil.copyfile(tFiles[0], tFiles[1])
                  os.chmod(tFiles[1], 0o777)
                  success += 1
              except :
                  ErrList.append(sys.exc_info())
                  print(ErrList[-1])
                  x = 0
  
      if success != num:
          msg  = "CopyRandomFilesToFolder src=%s, dst=%s, desired count=%d, Success=%d\n"%(src, dst, num, success)
  
          self._oLogger.LocalWriteLog(self._testname, 'CCmgCefHelper', msg, 0)
  
      return success
  </code></pre>
  
  <p>#</p>