mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
2b39da4997
commit
7a27c7ed4b
1 changed files with 1 additions and 1 deletions
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…
Add table
Add a link
Reference in a new issue