Browse Source

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.
pull/23285/head
Ronald Oussoren 5 years ago
committed by GitHub
parent
commit
7a27c7ed4b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      setup.py

2
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

Loading…
Cancel
Save