From 8f9336f39d87cc818c190be31f211a245e674ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ely=C3=A9zer=20Rezende?= Date: Mon, 28 Aug 2017 16:05:15 -0300 Subject: [PATCH] Update dump_as_yaml_to_file Create the temporary file as binary because `vault.decrypt` returns bytes and not string. Closes #235 --- rho/vault.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rho/vault.py b/rho/vault.py index 4dea33a..86f5a34 100644 --- a/rho/vault.py +++ b/rho/vault.py @@ -157,7 +157,7 @@ def dump_as_yaml_to_file(self, obj, file_path): :param obj: Python object to convert to yaml :param file_path: The file to write data to via temp file """ - with tempfile.NamedTemporaryFile(mode='w', delete=False) as data_temp: + with tempfile.NamedTemporaryFile(delete=False) as data_temp: self.dump_as_yaml(obj, data_temp) data_temp.close() move(data_temp.name, os.path.abspath(file_path))