diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-06-07 10:18:46 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-07 10:18:46 -0400 |
commit | 32a9da31438d51bfd49b3acbf0691c35feb4a974 (patch) | |
tree | cf468e2c43982a9dd1093335f3ec546801fa7501 /contrib/hldiff.py | |
parent | a974027efe9efcad9b334175163aa608a4d5bb31 (diff) |
Ignore encoding errors in filters
Fixes #161
Diffstat (limited to 'contrib/hldiff.py')
-rwxr-xr-x | contrib/hldiff.py | 1 |
1 files changed, 1 insertions, 0 deletions
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) |