From 9cee982a629128ec7968d97051f61d3e178483f8 Mon Sep 17 00:00:00 2001 From: Charles Paul Date: Mon, 23 Nov 2015 20:24:08 +0900 Subject: [PATCH] fixing errors with utf-8 values removing utf-8 stanza changing cast to binary_type instead using to_unicode --- lib/ansible/playbook/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py index c41cef8d303..83b7ff30735 100644 --- a/lib/ansible/playbook/base.py +++ b/lib/ansible/playbook/base.py @@ -36,6 +36,7 @@ from ansible.parsing.dataloader import DataLoader from ansible.playbook.attribute import Attribute, FieldAttribute from ansible.utils.boolean import boolean from ansible.utils.vars import combine_vars, isidentifier +from ansible.utils.unicode import to_unicode BASE_ATTRIBUTES = {} @@ -310,7 +311,7 @@ class Base: # and make sure the attribute is of the type it should be if value is not None: if attribute.isa == 'string': - value = text_type(value) + value = text_type(to_unicode(value)) elif attribute.isa == 'int': value = int(value) elif attribute.isa == 'float':