diff --git a/lib/ansible/utils/string_functions.py b/lib/ansible/utils/string_functions.py index 4972cc07625..3b452718f74 100644 --- a/lib/ansible/utils/string_functions.py +++ b/lib/ansible/utils/string_functions.py @@ -1,9 +1,12 @@ def isprintable(instring): - #http://stackoverflow.com/a/3637294 - import string - printset = set(string.printable) - isprintable = set(instring).issubset(printset) - return isprintable + if isinstance(instring, str): + #http://stackoverflow.com/a/3637294 + import string + printset = set(string.printable) + isprintable = set(instring).issubset(printset) + return isprintable + else: + return True def count_newlines_from_end(str): i = len(str)