From 346bb611c72088f9439f81f0a078f961d0c65b6c Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Wed, 21 May 2014 23:43:19 +0900 Subject: [PATCH] fix UnicodeEncodeError when prompt is unicode. --- lib/ansible/callbacks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index cbfd315e366..cbd72b05919 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -651,9 +651,10 @@ class PlaybookCallbacks(object): msg = 'input for %s: ' % varname def prompt(prompt, private): + msg = prompt.encode(sys.stdout.encoding) if private: - return getpass.getpass(prompt) - return raw_input(prompt) + return getpass.getpass(msg) + return raw_input(msg) if confirm: