In a message of Tue, 08 Sep 2015 04:37:09 -0700, harirammanohar...@gmail.com wr ites: >Some where i am missing simple logic.... :) > >===== >child = pexpect.spawn('ssh hari@hostname') >child.logfile = sys.stdout >child.expect('hari\'s Password: ') >===== > >getting error as follows: >============ >child.expect('hari\'s Password: ') >TypeError: must be str, not bytes >=========== > >Thanks... >-- >https://mail.python.org/mailman/listinfo/python-list
https://pexpect.readthedocs.org/en/latest/api/pexpect.html#run-function you want to use spawnu because you have a unicode string. Laura -- https://mail.python.org/mailman/listinfo/python-list