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.
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 9b804e6..d38974c 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -215,7 +215,7 @@
     done = {}
     notdone = {}
 
-    with open(filename) as f:
+    with open(filename, errors="surrogateescape") as f:
         lines = f.readlines()
 
     for line in lines: