Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96125
| From | Laura Creighton <lac@openend.se> |
|---|---|
| Subject | Re: issue while doing pexpect ssh |
| References | <3f4642c2-d548-4089-87c2-f3abb4ccb224@googlegroups.com> |
| Date | 2015-09-08 14:12 +0200 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.220.1441714357.8327.python-list@python.org> (permalink) |
In a message of Tue, 08 Sep 2015 04:37:09 -0700, harirammanohar159@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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-08 04:37 -0700
Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-08 14:12 +0200
Re: issue while doing pexpect ssh Chris Angelico <rosuav@gmail.com> - 2015-09-08 23:57 +1000
Re: issue while doing pexpect ssh jmp <jeanmichel@sequans.com> - 2015-09-08 16:56 +0200
Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-08 18:43 +0200
Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 01:58 -0700
Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-09 12:45 +0200
Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 02:19 -0700
Re: issue while doing pexpect ssh Laura Creighton <lac@openend.se> - 2015-09-09 12:47 +0200
Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 04:22 -0700
Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 22:18 -0700
Re: issue while doing pexpect ssh harirammanohar159@gmail.com - 2015-09-09 23:08 -0700
csiph-web