diff --git a/secret_loader/__init__.py b/secret_loader/__init__.py index 12f05f8..7caa285 100644 --- a/secret_loader/__init__.py +++ b/secret_loader/__init__.py @@ -184,7 +184,7 @@ class SecretLoader: try: with open(filepath) as f: return f.read().strip() - except FileNotFoundError: + except (FileNotFoundError, PermissionError): return None def _load_or_none_env(self, secret_name) -> str | None: @@ -210,7 +210,7 @@ class SecretLoader: check=False, shell=False, ) - except FileNotFoundError: + except (FileNotFoundError, PermissionError): return None return self._convert_pass_process_result_to_password(