Fixes to handle non-ascii become passwords

Fixes for non-ascii passwords on
* both python2 and python3,
* local and paramiko_ssh (ssh tested working with these changes)
* sudo and su

Fixes #16557
This commit is contained in:
Toshio Kuratomi 2016-10-15 13:57:21 -07:00
parent efc5dac52c
commit f24c10c32b
3 changed files with 42 additions and 41 deletions

View file

@ -310,7 +310,7 @@ class Connection(ConnectionBase):
if passprompt:
if self._play_context.become and self._play_context.become_pass:
chan.sendall(self._play_context.become_pass + '\n')
chan.sendall(to_bytes(self._play_context.become_pass) + b'\n')
else:
raise AnsibleError("A password is reqired but none was supplied")
else: