diff --git a/pcbnew/swig/python_scripting.cpp b/pcbnew/swig/python_scripting.cpp index 2fd02bc123..f3ced963a5 100644 --- a/pcbnew/swig/python_scripting.cpp +++ b/pcbnew/swig/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-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2018 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 @@ -450,7 +450,14 @@ wxString PyScriptingPath() wxFileName scriptPath( path ); scriptPath.MakeAbsolute(); - return scriptPath.GetFullPath(); + // Convert '\' to '/' in path, because later python script read \n or \r + // as escaped sequence, and create issues. Moreover, python uses unix notation in paths + // in many cases. + // It can happen on Windows. + path = scriptPath.GetFullPath(); + path.Replace( '\\', '/' ); + + return path; } wxString PyPluginsPath() diff --git a/scripting/kicadplugins.i b/scripting/kicadplugins.i index ddb9b01d8b..1da74d05e0 100644 --- a/scripting/kicadplugins.i +++ b/scripting/kicadplugins.i @@ -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-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2018 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 @@ -168,9 +168,11 @@ def LoadPlugins(bundlepath=None): Initialise Scripting/Plugin python environment and load plugins. Arguments: - scriptpath -- The path to the bundled scripts. + bundlepath -- The path to the bundled scripts. The bunbled Plugins are relative to this path, in the "plugins" subdirectory. + WARNING: bundlepath must use '/' as path separator, and not '\' + because it creates issues (\n and \r are seen as escaped seq) NOTE: These are all of the possible "default" search paths for kicad python scripts. These paths will ONLY be added to the python