<div dir="ltr">are you reloading processing plugin? the temporary path of processing are statically set once (c++ static var in QgsProcessingUtils) for qgis session => if you reload the processing plugin without exitig processing (e.g. to update the list of scripts), the oldtemp folder is no more available but still referenced => generating strange errors at the end of any process. Just rerun qgis to check if this is the problem.<div><br></div><div>There is no easy fix other that avoid static variable end method (e.g. refactoring) of QgsProcessignUtils, bts is not a common use case errors, but only happens to script developers => no fix is necessary.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Luigi Pirelli<br><br>**************************************************************************************************<br>* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" target="_blank">https://www.linkedin.com/in/luigipirelli</a><br>* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" target="_blank">http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>* GitHub: <a href="https://github.com/luipir" target="_blank">https://github.com/luipir</a><br>* Mastering QGIS 2nd Edition:<br>* <a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" target="_blank">https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition</a><br>* Hire me: <a href="http://goo.gl/BYRQKg" target="_blank">http://goo.gl/BYRQKg</a><br>**************************************************************************************************</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 3 Sep 2018 at 16:52, matteo <<a href="mailto:matteo.ghetta@gmail.com">matteo.ghetta@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I was thinking to add a small example of addLayerToLoadOnCompletion<br>
function to the ScriptTemplate of Processing. The code is the following:<br>
<br>
    buffered_layer = processing.run("native:buffer", parameters={<br>
        'INPUT': dest_id,<br>
        'DISTANCE': 10000,<br>
        'SEGMENTS': 5,<br>
        'END_CAP_STYLE': 0,<br>
        'JOIN_STYLE': 0,<br>
        'MITER_LIMIT': 2,<br>
        'DISSOLVE': False,<br>
        'OUTPUT': 'memory:'<br>
    }, context=context, feedback=feedback)['OUTPUT']<br>
<br>
    feedback.pushDebugInfo(str(dest_id))<br>
<br>
    context.addLayerToLoadOnCompletion(buffered_layer.source(),<br>
context.LayerDetails(<br>
        name='new_layer',<br>
        project=context.project()<br>
    ))<br>
<br>
but Processing always throws this error:<br>
<br>
The following layers were not correctly<br>
generated.<ul><li>Polygon?crs=EPSG:3003&field=ID:long(10)&field=fk:string(254)&field=ROTAZ:long(10)&field=DIMENS:long(10)&field=ETICHETTA:string(254)&field=VALORE:long(10)&field=T_MIN:double(20,5)&field=T_MAX:double(20,5)&field=PIOGGIA:double(20,5)&field=LARGH:double(20,5)&field=LUNG:double(20,5)&field=assex:string(254)&field=assey:string(254)&field=colore:string(38)&field=xlab:double(10,2)&field=ylab:double(10,2)&field=raster:double(23,15)&field=raster_1:double(23,15)&field=raster_2:double(23,15)&uid={685540af-711d-462b-a9d0-9b00af4c2f6a}</li></ul>You<br>
can check the 'Log Messages Panel' in QGIS main window to find more<br>
information about the execution of the algorithm.<br>
<br>
<br>
Am I missing something?<br>
<br>
Thanks for any suggestion<br>
<br>
Matteo<br>
<br>
<br>
<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>