From e4bb1560c5a369d9f4886e9a58f557e4f3aeb9e0 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 23 Aug 2022 09:41:11 -0700 Subject: [PATCH] Set locale in python save routine Fixes https://gitlab.com/kicad/code/kicad/issues/11006 (cherry picked from commit c3496d61eb049a4af6bd92d79a9c41015d1310de) --- pcbnew/python/scripting/pcbnew_scripting_helpers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index 4ac56bc811..1f69dfc8c5 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -243,6 +243,10 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat, aBoard->BuildConnectivity(); aBoard->SynchronizeNetsAndNetClasses(); + // Ensure the "C" locale is temporary set, before saving any file + // It also avoid wxWidget alerts about locale issues, later, when using Python 3 + LOCALE_IO dummy; + try { IO_MGR::Save( aFormat, aFileName, aBoard, nullptr );