diff --git a/pcbnew/python/plugins/PadArray.py b/pcbnew/python/plugins/PadArray.py index 60a6e93971..9edbb18c2b 100644 --- a/pcbnew/python/plugins/PadArray.py +++ b/pcbnew/python/plugins/PadArray.py @@ -212,7 +212,11 @@ class PadGridArray(PadArray): @param py: pitch in y-direction @param centre: array centre point """ - super(PadGridArray, self).__init__(pad) + + try: + super().__init__(pad) + except TypeError: + super(PadGridArray, self).__init__(pad) self.nx = int(nx) self.ny = int(ny) diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index 8718b04ce4..17c37c5530 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -45,6 +45,8 @@ #include #include #include +#include + static PCB_EDIT_FRAME* s_PcbEditFrame = NULL; @@ -124,6 +126,10 @@ BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) pro.MakeAbsolute(); wxString projectPath = pro.GetFullPath(); + // Ensure the "C" locale is temporary set, before reading any file + // It also avoid wxWidget alerts about locale issues, later, when using Python 3 + LOCALE_IO dummy; + PROJECT* project = GetSettingsManager()->GetProject( projectPath ); if( !project )