[QGIS-Developer] DB Manager regressions on 2.18. Generic SIP ownership errors?

Luigi Pirelli luipir at gmail.com
Mon May 8 07:03:49 PDT 2017

Continuing to work on some regressions on 2.18 (next LTR)

I'm working on https://issues.qgis.org/issues/15868 and I'm preparing
a patch for that. But it's a patch!
My colleague Giovanni Manghi hav stressed the patch and found other
errors (below). I wasn't able to reproduce, but as in #15868 this kind
of error can be generated breaking the binding lifecycle
(http://enki-editor.org/2014/08/23/Pyqt_mem_mgmt.html -

Is there a way to automaticaly scan the code and rise-up this kind of
sip binding errors?

Luigi Pirelli

* Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
* https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition

I just got this

2017-05-05T19:30:37 1 Traceback (most recent call last):
File "/home/giovanni/.qgis2/python/plugins/db_manager/dlg_sql_window.py",
line 272, in loadSqlLayer
layer = self._getSqlLayer(self.filter)
File "/home/giovanni/.qgis2/python/plugins/db_manager/dlg_sql_window.py",
line 263, in _getSqlLayer
self.avoidSelectById.isChecked(), _filter)
File "/home/giovanni/.qgis2/python/plugins/db_manager/db_plugins/plugin.py",
line 284, in toSqlLayer
provider = self.dbplugin().providerName()
File "/home/giovanni/.qgis2/python/plugins/db_manager/db_plugins/plugin.py",
line 228, in dbplugin
return self.parent()
RuntimeError: wrapped C/C++ object of type PGDatabase has been deleted

this is different from the upstream error reported in
https://issues.qgis.org/issues/15868, possibly (not really sure)
depending on your path because it shows when using a functionality
that works ok in the unpatched (core) version.

open SQL Window
do the following query on a polygon layer (makes the proper
substitutions where necessary):

SELECT ST_Centroid(geom)
FROM tablename
WHERE attributename = 'attributevalue';

then activate the "load as new layer" chekbox and choose for for both
the "column with unique values" and "geometry column" the
"st_centroid" temp column created by the query.
now click on "load now" and check the log. On the unpatched version
the query layer (containing 1 point) is loaded in QGIS.


More information about the QGIS-Developer mailing list