8000 bpo-42351: Avoid error when opening header with non-UTF8 encoding (GH… · python/cpython@7a27c7e · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 7a27c7e

Browse files
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.
1 parent 2b39da4 commit 7a27c7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def is_macosx_sdk_path(path):
241241

242242
def grep_headers_for(function, headers):
243243
for header in headers:
244-
with open(header, 'r') as f:
244+
with open(header, 'r', errors='surrogateescape') as f:
245245
if function in f.read():
246246
return True
247247
return False

0 commit comments

Comments
 (0)
0