You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git development branch b7f96c8
Python version '3.9.2'
Description
Adding a call to DomoticzEx.Register() in a python plugin causes a crash at startup (see log further down). This will only occur during Domoticz start. Adding the plugin and disable/enable works fine.
This is caused by PyDomoticz_Register() trying to return Py_RETURN_NONE before the Py_None object is created. Changing the return to return Py_BuildValue(""); seems to fix the problem. But I don't have enough experience of Domoticz or the Python API to say if this is correct.
With this change I get the following error on exit
2022-10-28 12:28:13.670 Error: Stop: Unit 'Dimmer' Reference Count not one: 2.
2022-10-28 12:28:13.671 Error: regtest: Stop: Device 'Dimmer' Reference Count not correct, expected 1 found 3.
I suspect that this is an additional error, but could also be caused by my fix.
This crash appears to be an accidental side effect of the change to the Plugin Framework to use Python's global 'None' value rather than having it's own. Turned out that Domoticz having its own 'None' caused 'None' comparisons to fail inside plugin functions which isn't great.
I will push a fix where the the Plugin Framework gets a reference to the global None prior to importing the plugin which will resolve this.
docker:latest
Domoticz V2022.1 (build 14580) (c)2012-2022 GizMoCuz
Build Hash: b7f96c8, Date: 2022-10-19 15:52:59
Python version '3.7.3'
git development branch
b7f96c8
Python version '3.9.2'
Description
Adding a call to DomoticzEx.Register() in a python plugin causes a crash at startup (see log further down). This will only occur during Domoticz start. Adding the plugin and disable/enable works fine.
This is caused by PyDomoticz_Register() trying to return Py_RETURN_NONE before the Py_None object is created. Changing the return to
return Py_BuildValue("");
seems to fix the problem. But I don't have enough experience of Domoticz or the Python API to say if this is correct.With this change I get the following error on exit
I suspect that this is an additional error, but could also be caused by my fix.
Information from log on Domoticz start
The text was updated successfully, but these errors were encountered: