diff --git a/common/filename_resolver.cpp b/common/filename_resolver.cpp index 514d6ac72a..9d51f3522b 100644 --- a/common/filename_resolver.cpp +++ b/common/filename_resolver.cpp @@ -188,7 +188,7 @@ bool FILENAME_RESOLVER::createPathList() } else { - fndummy.Assign( pathVal, "" ); + fndummy.Assign( pathVal, wxEmptyString ); fndummy.Normalize( FN_NORMALIZE_FLAGS ); lpath.m_Pathexp = fndummy.GetFullPath(); } diff --git a/scripting/python_scripting.cpp b/scripting/python_scripting.cpp index 1541515fe8..86bc02b0ff 100644 --- a/scripting/python_scripting.cpp +++ b/scripting/python_scripting.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -120,7 +121,9 @@ bool SCRIPTING::scriptingSetup() pyHome.Assign( Pgm().GetExecutablePath() ); - pyHome.Normalize(); + // @warning Do we want to use our own ExpandEnvVarSubstitutions() here rather than depend + // on wxFileName::Normalize() to expand environment variables. + pyHome.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ); // MUST be called before Py_Initialize so it will to create valid default lib paths if( !wxGetEnv( wxT( "KICAD_USE_EXTERNAL_PYTHONHOME" ), nullptr ) )