mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
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.
This commit is contained in:
parent
acd0fda1a4
commit
75d8c5cea2
4 changed files with 11 additions and 3 deletions
|
@ -271,7 +271,7 @@ def parse_makefile(fn, g=None):
|
|||
used instead of a new dictionary.
|
||||
"""
|
||||
from distutils.text_file import TextFile
|
||||
fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1)
|
||||
fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1, errors="surrogateescape")
|
||||
|
||||
if g is None:
|
||||
g = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue