[QGIS-Developer] Issue when using subprocess in the Processing toolbox

Fredrik Lindberg fredrikl at gvc.gu.se
Fri Oct 28 05:51:58 PDT 2022


Hello,
I am one of the maintainers of the Plugin (FUSION for Processing) that makes is possible to use FUSION LVD LIDAR analysis and visualization software in QGIS on Windows computers. I am experiencing a very strange issue that I do not understand. It appears using PolyClipData64.exe via a the subprocess Python library.

With the test data I use I can run the tool via a command prompt using the command below:

"C:/FUSION\PolyClipData64.exe" /class:1 "D:\LidarQGISFUSION\FastighetskartanVektor_1501_3006\by_get.shp" "D:/LidarQGISFUSION/tempfromscript/test.las" "D:\LidarQGISFUSION\tempfromscript\clippedLidar.las"

Then I make use of the function Popen in subprocess in the Python console in QGIS without error:
fused_command = '"C:/FUSION\PolyClipData64.exe" "/class:1" "D:/LidarQGISFUSION/FastighetskartanVektor_1501_3006/by_get.shp" "D:/LidarQGISFUSION/tempfromscript/test11.las" "D:/LidarQGISFUSION/tempfromscript/clippedLidar.las"'

subprocess.Popen(fused_command,shell=True,stdout=subprocess.PIPE, stdin=subprocess.DEVNULL,stderr=subprocess.STDOUT,universal_newlines=True)

But when I use the same code snippet in my processing plugin it fails.

Does anyone have an idea what might be going on here?

Any suggestion highly appreciated!

/Fredrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20221028/e2e2df6a/attachment.htm>


More information about the QGIS-Developer mailing list