Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Lib/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def _parse_makefile(filename, vars=None):
done = {}
notdone = {}

with open(filename, errors="surrogateescape") as f:
with open(filename, encoding=sys.getfilesystemencoding(),
errors="surrogateescape") as f:
lines = f.readlines()

for line in lines:
Expand Down Expand Up @@ -388,7 +389,7 @@ def _generate_posix_vars():
# load the installed pyconfig.h:
config_h = get_config_h_filename()
try:
with open(config_h) as f:
with open(config_h, encoding="utf-8") as f:
parse_config_h(f, vars)
except OSError as e:
msg = "invalid Python installation: unable to open %s" % config_h
Expand Down