summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2020-11-14 15:07:47 (GMT)
committerGitHub <noreply@github.com>2020-11-14 15:07:47 (GMT)
commit7a27c7ed4b2b45bb9ea27d3f5c4f423495d6e939 (patch)
tree6718788266a825093ecefcd7fe6ce503a78c1b12 /setup.py
parent2b39da49974bda523c5c1a8777bbe30dbafdcd12 (diff)
downloadcpython-7a27c7ed4b2b45bb9ea27d3f5c4f423495d6e939.zip
cpython-7a27c7ed4b2b45bb9ea27d3f5c4f423495d6e939.tar.gz
cpython-7a27c7ed4b2b45bb9ea27d3f5c4f423495d6e939.tar.bz2
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.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index c12b5f5..91358af 100644
--- a/setup.py
+++ b/setup.py
@@ -241,7 +241,7 @@ def is_macosx_sdk_path(path):
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