forked from espressif/esp-idf
tools: Avoid Unicode error in kconfiglib while opening files
This fix is for IDF v4.0 and earlier versions. The upstream kconfiglib included since IDF v4.1 doesn't have this issue. Closes https://github.com/espressif/esp-idf/issues/4977
This commit is contained in:
@@ -1125,7 +1125,7 @@ class Kconfig(object):
|
|||||||
was set when the configuration was loaded.
|
was set when the configuration was loaded.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return open(filename)
|
return open(filename) if sys.version_info[0] < 3 else open(filename, encoding='utf-8')
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
if not os.path.isabs(filename) and self.srctree is not None:
|
if not os.path.isabs(filename) and self.srctree is not None:
|
||||||
filename = os.path.join(self.srctree, filename)
|
filename = os.path.join(self.srctree, filename)
|
||||||
|
Reference in New Issue
Block a user