Help Troubleshooting

Victor Subervi victorsubervi at
Fri Mar 12 17:22:19 CET 2010

I'm running Pexpect (no discussion list) with the following code:

#! /usr/bin/python
import pexpect

def runVpopmail(whatdo, acct, domain, newpw, oldpw=''):
  if whatdo == 'vadduser':
    child = pexpect.spawn('/home/vpopmail/bin/%s %s@%s %s' % (whatdo, acct,
domain, newpw))
  elif whatdo == 'vchangepw':
    child = pexpect.spawn('/home/vpopmail/bin/%s' % (whatdo))
    child.expect('Please enter the email address: ')
    child.sendline('%s@%s' % (acct, domain))
    child.expect('Enter old password: ')
    child.expect('Please enter password for %s@%s: ' % (acct, domain))
    child.expect('enter password again: ')
  return child

No matter whether I try to add a user or edit a password, the fn seems to
return that everything is good, but nothing ever happens. When I place a
return of the child value and run it with whatdo==vadduser I get the
following output:

version: 2.3 ($Revision: 399 $) command: /home/vpopmail/bin/vadduser args:
['/home/vpopmail/bin/vadduser', 'test2 at', 'qqq']
searcher: None buffer (last 100 chars): before (last 100 chars): None after:
None match: None match_index: None exitstatus: None flag_eof: False pid:
1518 child_fd: 3 closed: False timeout: 30 delimiter: pexpect.EOF logfile:
None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False
searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1
delayafterterminate: 0.

I don't know what this means. Any ideas on how to troubleshoot this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list