title: pexpect not working properly
body: <p>I am trying to copy some files from remote server to my machine. I use spawn in pexpect for authenticating when asked. I am partially successful in downloading the file from server. The Problem is before completing the download its throwing an exception " ETAException pexpect.ExceptionPexpect: ExceptionPexpect() in > ignored"</p>
  
  <p>Below is my code:</p>
  
  <pre><code>def doScp(user,password,host,remotepath,localpath,files):
  try:
      print files
      child = pexpect.spawn('sudo scp -C %s:%s%s %s' % (host, remotepath, files, localpath))
      child.logfile = sys.stdout
      print 'scp -C %s:%s%s %s' % (host, remotepath, files, localpath)
      i = child.expect(['assword', r"yes/no"], timeout=20)
      if i == 0:
          print "Value of I is Zero\n"
          child.sendline(password)
          j = child.expect(['yes/no'],timeout=20)
          if j == 0:
              child.sendline("yes")
          child.expect(pexpect.EOF, timeout=None)
      elif i == 1:
          child.sendline("yes")
          child.expect("assword", timeout=20)
          child.sendline(password)
          child.expect(pexpect.EOF, timeout=None)
      child.interact()
  except pexpect.ExceptionPexpect, e:
      return False
  </code></pre>