From 7c13c4b2074ed3e3b4a9301ff686df789478451d Mon Sep 17 00:00:00 2001 From: Joren Vrancken Date: Tue, 31 Jul 2018 10:54:04 +0200 Subject: [PATCH] Add specific exceptions to except --- lib/ansible/template/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/template/__init__.py b/lib/ansible/template/__init__.py index 6c7ef828996..162f41c4838 100644 --- a/lib/ansible/template/__init__.py +++ b/lib/ansible/template/__init__.py @@ -86,7 +86,7 @@ def generate_ansible_template_vars(path): b_path = to_bytes(path) try: template_uid = pwd.getpwuid(os.stat(b_path).st_uid).pw_name - except: + except (KeyError, TypeError): template_uid = os.stat(b_path).st_uid temp_vars = {}