From 32a9da31438d51bfd49b3acbf0691c35feb4a974 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 7 Jun 2019 10:18:46 -0400 Subject: Ignore encoding errors in filters Fixes #161 --- contrib/hldiff.py | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/hldiff.py') diff --git a/contrib/hldiff.py b/contrib/hldiff.py index 9c81663..5f660fd 100755 --- a/contrib/hldiff.py +++ b/contrib/hldiff.py @@ -7,6 +7,7 @@ ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') stat_re = re.compile(r'(| \d+ )(\+*)(\-*)') lines_re = re.compile(r'@@ (-\d+,\d+ \+\d+,\d+) @@') +sys.stdin.reconfigure(encoding='utf-8', errors='ignore') patch = sys.stdin.read().replace("\r\n", "\n") patch = ansi_escape.sub('', patch) -- cgit 1.4.1-2-gfad0