HierPlace icon indicating copy to clipboard operation
HierPlace copied to clipboard

..\..\pcbnew\action_plugin.cpp(163): assert "PgmOrNull()" failed in ACTION_PLUGINS::register_action().

Open QGB opened this issue 3 years ago • 3 comments

kicad-6.0.9-x86_64.exe

Win10 x64 kicad 6.0.9 python 3.914

Error in import hierplace

minimal reproducible code:

import _pcbnew
from hierplace.HierPlace import HierPlace

h= HierPlace() # <hierplace.HierPlace.HierPlace at 0x1311f2b3ca0>

_pcbnew.PYTHON_ACTION_PLUGINS_register_action(h)

image

https://github.com/devbisme/kinet2pcb/issues/9

QGB avatar Nov 04 '22 16:11 QGB

@devbisme need help

QGB avatar Nov 04 '22 16:11 QGB

image

py.pdb(f=U.logging.warning,msg='123')
> c:\qgb\babun\cygwin\bin\qgb\py.py(246)pdb()
-> return f(**ka)
(Pdb) b c:\program files\kicad\6.0\bin\lib\logging\__init__.py:1589
Breakpoint 1 at c:\program files\kicad\6.0\bin\lib\logging\__init__.py:1589
(Pdb) v
*** NameError: name 'v' is not defined
(Pdb) c
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1589)_log()
-> self.handle(record)
(Pdb) s
--Call--
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1591)handle()
-> def handle(self, record):
(Pdb) n
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1598)handle()
-> if (not self.disabled) and self.filter(record):
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1599)handle()
-> self.callHandlers(record)
(Pdb) s
--Call--
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1645)callHandlers()
-> def callHandlers(self, record):
(Pdb) n
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1655)callHandlers()
-> c = self
(Pdb) n
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1656)callHandlers()
-> found = 0
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1657)callHandlers()
-> while c:
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1658)callHandlers()
-> for hdlr in c.handlers:
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1659)callHandlers()
-> found = found + 1
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1660)callHandlers()
-> if record.levelno >= hdlr.level:
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(1661)callHandlers()
-> hdlr.handle(record)
(Pdb) s
--Call--
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(939)handle()
-> def handle(self, record):
(Pdb) n
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(948)handle()
-> rv = self.filter(record)
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(949)handle()
-> if rv:
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(950)handle()
-> self.acquire()
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(951)handle()
-> try:
(Pdb) 
> c:\program files\kicad\6.0\bin\lib\logging\__init__.py(952)handle()
-> self.emit(record)
(Pdb) !self
<StreamHandler (DEBUG)>
(Pdb) !self.stream
(Pdb) 

QGB avatar Nov 05 '22 05:11 QGB

I haven't seen any errors when running HierPlace within PCBNEW (either version 5 or 6).

I have seen the following error when using generate_pcb() in skidl:

./kicad/pcbnew/action_plugin.cpp(163): assert "PgmOrNull()" failed in register_action().

This may be caused by importing HierPlace outside of a running instance of PCBNEW. However, skidl still generates the correct PCB file despite the error.

devbisme avatar Nov 07 '22 20:11 devbisme