commit | 7a27c7ed4b2b45bb9ea27d3f5c4f423495d6e939 | [log] [tgz] |
---|---|---|
author | Ronald Oussoren <ronaldoussoren@mac.com> | Sat Nov 14 16:07:47 2020 +0100 |
committer | GitHub <noreply@github.com> | Sat Nov 14 16:07:47 2020 +0100 |
tree | 6718788266a825093ecefcd7fe6ce503a78c1b12 | |
parent | 2b39da49974bda523c5c1a8777bbe30dbafdcd12 [diff] [blame] |
bpo-42351: Avoid error when opening header with non-UTF8 encoding (GH-23279) grep_headers_for() would error out when a header contained text that cannot be interpreted as UTF-8.
diff --git a/setup.py b/setup.py index c12b5f5..91358af 100644 --- a/setup.py +++ b/setup.py
@@ -241,7 +241,7 @@ def grep_headers_for(function, headers): for header in headers: - with open(header, 'r') as f: + with open(header, 'r', errors='surrogateescape') as f: if function in f.read(): return True return False