mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
bpo-43651: Fix EncodingWarning in sysconfig (GH-25192)
This commit is contained in:
parent
7bc25ec727
commit
3d4af4a876
1 changed files with 3 additions and 2 deletions
|
|
@ -240,7 +240,8 @@ def _parse_makefile(filename, vars=None):
|
||||||
done = {}
|
done = {}
|
||||||
notdone = {}
|
notdone = {}
|
||||||
|
|
||||||
with open(filename, errors="surrogateescape") as f:
|
with open(filename, encoding=sys.getfilesystemencoding(),
|
||||||
|
errors="surrogateescape") as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
|
@ -388,7 +389,7 @@ def _generate_posix_vars():
|
||||||
# load the installed pyconfig.h:
|
# load the installed pyconfig.h:
|
||||||
config_h = get_config_h_filename()
|
config_h = get_config_h_filename()
|
||||||
try:
|
try:
|
||||||
with open(config_h) as f:
|
with open(config_h, encoding="utf-8") as f:
|
||||||
parse_config_h(f, vars)
|
parse_config_h(f, vars)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
msg = "invalid Python installation: unable to open %s" % config_h
|
msg = "invalid Python installation: unable to open %s" % config_h
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue