diff --git a/tools/idf.py b/tools/idf.py index e6573f149d..e5a5e77a1e 100755 --- a/tools/idf.py +++ b/tools/idf.py @@ -677,7 +677,7 @@ def init_cli(verbose_output=None): def main(): checks_output = check_environment() cli = init_cli(verbose_output=checks_output) - cli(prog_name=PROG) + cli(sys.argv[1:], prog_name=PROG) def _valid_unicode_config(): diff --git a/tools/idf_py_actions/core_ext.py b/tools/idf_py_actions/core_ext.py index b728dd4e9c..952477a451 100644 --- a/tools/idf_py_actions/core_ext.py +++ b/tools/idf_py_actions/core_ext.py @@ -35,7 +35,9 @@ def action_extensions(base_actions, project_path): Menuconfig target is build_target extended with the style argument for setting the value for the environment variable. """ - os.environ['MENUCONFIG_STYLE'] = style + # The subprocess lib cannot accept environment variables as "unicode" . This is a problem + # only in Python 2. + os.environ['MENUCONFIG_STYLE'] = style.encode(sys.getfilesystemencoding() or 'utf-8') build_target(target_name, ctx, args) def fallback_target(target_name, ctx, args):