Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pcbnew.py”, line 6860, in LoadBoard
return _pcbnew.LoadBoard(*args)
Traceback (most recent call last):
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/shell.py”, line 562, in OnKeyDown
self.processLine()
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/shell.py”, line 886, in processLine
self.push(command)
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/shell.py”, line 976, in push
self.more = self.interp.push(command)
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/interpreter.py”, line 80, in push
more = self.more = self.runsource(source)
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/interpreter.py”, line 90, in runsource
more = InteractiveInterpreter.runsource(self, source)
File “C:\Program Files\KiCad\lib\python2.7/code.py”, line 87, in runsource
self.runcode(code)
File “C:\Program Files\KiCad\lib\python2.7/code.py”, line 107, in runcode
self.showtraceback()
File “C:\Program Files\KiCad\lib\python2.7/code.py”, line 162, in showtraceback
map(self.write, list)
File “C:\Program Files\KiCad\lib\python2.7/code.py”, line 171, in write
sys.stderr.write(data)
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/shell.py”, line 1247, in writeErr
self.write(text)
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/py/shell.py”, line 1001, in write
self.AddText(text)
File “C:\Program Files\KiCad\lib\python2.7\site-packages\wx-3.0-msw/wx/stc.py”, line 2041, in AddText
return _stc.StyledTextCtrl_AddText(*args, **kwargs)
File “C:\Program Files\KiCad\lib\python2.7/encodings/cp1252.py”, line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 101: character maps to
Application: Pcbnew
Version: (5.1.5)-3, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0
libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.66.0
Compiler: GCC 9.2.0 with C++ ABI 1013
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON
Windows 10. Not sure how or why it’s picking the cp1252 encoding. Loading KiCad, starting pcbnew, then starting the Script Console. Then typing in those two commands right from the beginning.
I’ve tried this with recent 5.1.5 nightly and 5.99 nigthly. I’get the same results in both cases
Version: (5.1.5-68-g1cbee4c50)-1
Version: (5.99.0-804-g88e0ef548)
Looks like there may be some kind of error in wxWidgets? Not sure why that’s in my error message. Do you have the full version/help text of the version that works for you? (I’m using the stable release).
I think the error boils down to “can’t find file”. It’d be great if this error message is improved.
When I put the full file path and name in quotes, the LoadBoard function returns properly and appears to load the board. I’m not sure what path is prepended to the LoadBoard filename, but when I check the getcwd, the full path would not be found.
Did you by any chance disable the instalation of Demo files? I’ve checked the location of C:\Program Files\KiCad\share\kicad\demos\complex_hierarchy and I have a project there.
On (5.1.5-68-g1cbee4c50)-1
import sys
sys.getdefaultencoding()
'ascii'
import os
os.getcwd()
'C:\\Program Files\\KiCad'
on (5.99.0-804-g88e0ef548)
import sys
sys.getdefaultencoding()
'ascii'
import os
os.getcwd()
'C:\\Program Files\\KiCad_nightly'
The directory is KiCommand, the plug-in I wrote. I’m trying to find out if it’s in the source of the plug-in or somehow due to KiCAD doing something. It might be in code that saves local information.
Edit: turns out there is an explicit os.chdir() in KiCommand startup. I want to rework that to remove it.