From 9991a530ab039a2407344a295177ccfeb0f3a2b6 Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Thu, 8 Aug 2013 22:09:45 +0200 Subject: [PATCH] fix an encoding bug in copy content = lookup plugin closes #3518 --- lib/ansible/runner/action_plugins/copy.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index f5466cf8e2..38d2ee6abe 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -26,6 +26,13 @@ import stat import tempfile import pipes +## fixes https://github.com/ansible/ansible/issues/3518 +# http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html +import sys +reload(sys) +sys.setdefaultencoding("utf8") + + class ActionModule(object): def __init__(self, runner):