From c13d0037a44a5f0e55cdfb3e1aaf31f50fb27ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20M=C3=BChlenschulte?= Date: Tue, 2 Jul 2019 16:10:02 +0200 Subject: [PATCH] don't stop on encoding-errors --- pre_commit_hooks/detect_aws_credentials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit_hooks/detect_aws_credentials.py b/pre_commit_hooks/detect_aws_credentials.py index da80ab4..328116b 100644 --- a/pre_commit_hooks/detect_aws_credentials.py +++ b/pre_commit_hooks/detect_aws_credentials.py @@ -76,7 +76,7 @@ def check_file_for_aws_keys(filenames, keys): bad_files = [] for filename in filenames: - with open(filename, 'r') as content: + with open(filename, 'r', errors='ignore') as content: text_body = content.read() for key in keys: # naively match the entire file, low chance of incorrect