[Qgis-developer] save project via python results in segfault

Richard Duivenvoorde rdmailings at duif.net
Mon Oct 25 10:13:03 EDT 2010


Martin Dobias wrote:
> Hi Richard
> 
> On Sun, Oct 24, 2010 at 9:03 PM, Richard Duivenvoorde
> <rdmailings at duif.net> wrote:
>> p=QgsProject.instance()
>> p.setFileName(str("/home/richard/temp/bpprr.qgs"))
>> p.write()
>>
>> I've been looking at it by putting debug messages in cpp code, and to me
>> it seems the crash appears when in
>> qgspythonutilsimpl.cpp: 153: the method runString is called with the
>> parameter "sys.path.append('/home/richard/temp')"
> 
> I think this kind of crash happens probably always when Python calls
> C++ and C++ again calls some Python code. I am not sure what exactly
> happens and whether this is caused by PyQt/sip or python itself...

ok, then would it be a workaround to add a python qgis-api method for
this? Or will we have the same problem then? ( the
QgsProject::write()-method emits a 'writeProject'-event which will be
received by the python part again. isn't it? ).

Otherwise, should we conclude that it is not possible to save a project
via python then (and in case of mapserver plugin I would let user NOT
use plugin without a saved project in the beginning anyway...)?

Richard


More information about the Qgis-developer mailing list