From e386a51cf8950cee0f3a51c4fa3f166ec354a262 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 19 Apr 2016 08:32:08 -0700 Subject: [PATCH] Trnasform file name to bytes before opening it to avoid unicode errors if python tries to encode it implicitly --- lib/ansible/parsing/dataloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/parsing/dataloader.py b/lib/ansible/parsing/dataloader.py index 5043d0e7932..42aa7fd83e6 100644 --- a/lib/ansible/parsing/dataloader.py +++ b/lib/ansible/parsing/dataloader.py @@ -329,7 +329,7 @@ class DataLoader(): real_path = self.path_dwim(file_path) try: - with open(real_path, 'rb') as f: + with open(to_bytes(real_path), 'rb') as f: data = f.read() if self._vault.is_encrypted(data): # if the file is encrypted and no password was specified,