From 402dba4197fcddc6f0ca6a5299e7c9a63f555f78 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 23 Jul 2019 16:04:44 +0100 Subject: [PATCH] module_finder: pass raw file to compile() Newer Ansibles have e.g. UTF-8 present in apt.py. --- ansible_mitogen/module_finder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_mitogen/module_finder.py b/ansible_mitogen/module_finder.py index 633e3cad..89aa2beb 100644 --- a/ansible_mitogen/module_finder.py +++ b/ansible_mitogen/module_finder.py @@ -57,7 +57,7 @@ def get_code(module): """ Compile and return a Module's code object. """ - fp = open(module.path) + fp = open(module.path, 'rb') try: return compile(fp.read(), str(module.name), 'exec') finally: