diff --git a/lib/ansible/executor/module_common.py b/lib/ansible/executor/module_common.py index 28245be6e33..41b57b5fcbe 100644 --- a/lib/ansible/executor/module_common.py +++ b/lib/ansible/executor/module_common.py @@ -212,12 +212,12 @@ def debug(command, zipped_mod, json_params): directory = os.path.dirname(dest_filename) if not os.path.exists(directory): os.makedirs(directory) - f = open(dest_filename, 'w') + f = open(dest_filename, 'wb') f.write(z.read(filename)) f.close() # write the args file - f = open(args_path, 'w') + f = open(args_path, 'wb') f.write(json_params) f.close()