summaryrefslogtreecommitdiff
path: root/Lib/sysconfig.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-23 17:02:31 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-23 17:02:31 +0000
commitb8f45f0354307c011fae735d579468727abd0787 (patch)
tree73455b7310e670e260f1567e44530aef3df30061 /Lib/sysconfig.py
parentf7c83bfde202cb6346337bbcbb447ca0a7ecd5f3 (diff)
downloadcpython-b8f45f0354307c011fae735d579468727abd0787.tar.gz
Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source code directory name contains a non-ASCII character and the locale encoding is ASCII.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r--Lib/sysconfig.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 9b804e6b88..d38974c561 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -215,7 +215,7 @@ def _parse_makefile(filename, vars=None):
done = {}
notdone = {}
- with open(filename) as f:
+ with open(filename, errors="surrogateescape") as f:
lines = f.readlines()
for line in lines: