Skip to content

Commit 732470c

Browse files
committed
Fix utf8 file names issue in linux
For whatever reason wxGTK does some switcheroo of the encoding used for filename strings (used by wxFopen and alike) when wxApp is initialised and not before. So you are forced to create wx.App() before attempting to load pcb even if you don't need any windows. :bleh:
1 parent 81618dc commit 732470c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

InteractiveHtmlBom/generate_interactive_bom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,14 @@ def Run(self):
647647
config = Config()
648648
config.add_options(parser)
649649
args = parser.parse_args()
650-
if not os.path.isfile(args.file):
650+
if not os.path.isfile(args.file.decode('utf8')):
651651
print("File %s does not exist." % args.file)
652652
exit(1)
653653
print("Loading %s" % args.file)
654-
board = pcbnew.LoadBoard(os.path.abspath(args.file))
654+
app = wx.App()
655+
board = pcbnew.LoadBoard(os.path.abspath(args.file).decode('utf8'))
655656
if args.show_dialog:
656657
# Create simple app to show config dialog, infer config.
657-
app = wx.App()
658658
dlg = dialog.SettingsDialog(None, extra_data_func=parse_schematic_data)
659659
config.netlist_initial_directory = os.path.dirname(args.file)
660660
config.transfer_to_dialog(dlg.panel)

0 commit comments

Comments
 (0)