From e0364cbde126c694712fb4d921006372939a3b31 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 23 Mar 2020 11:36:10 +0100 Subject: [PATCH] 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 --- tools/kconfig_new/kconfiglib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kconfig_new/kconfiglib.py b/tools/kconfig_new/kconfiglib.py index c17b32b4a..509237134 100644 --- a/tools/kconfig_new/kconfiglib.py +++ b/tools/kconfig_new/kconfiglib.py @@ -1125,7 +1125,7 @@ class Kconfig(object): was set when the configuration was loaded. """ try: - return open(filename) + return open(filename) if sys.version_info[0] < 3 else open(filename, encoding='utf-8') except IOError as e: if not os.path.isabs(filename) and self.srctree is not None: filename = os.path.join(self.srctree, filename)