Open anikaweinmann opened 3 years ago
This is not a bug, parse_command is supposed to give you parsed stdout or throw exception as you would expect from a Python function. You probably need to use start_command
, which is lower-level and allows you to capture stdout and stderr. I suggest to better specify what you would expect and open it as feature request.
Describe the bug By using
parse_command(...)
in Python the whole Python trace is shown if the module fails and can only be transformed to an Error message withgrass.Popen(...)
e.g. in like addon as https://github.com/OSGeo/grass-addons/blob/master/grass7/imagery/i.sentinel/i.sentinel.coverage/i.sentinel.coverage.py#L231-L251 (https://github.com/OSGeo/grass-addons/pull/434/files). The error trace look e.g. like this:To Reproduce Steps to reproduce the behavior with the error
FEHLER: Invalid settings file
:touch .esa_sentinel2
python3
Expected behavior It would be nice if
grass.parse_command(...)
returned an error properly, so that the whole Python trace is not visible and you can then just pass on the error.System description (please complete the following information):
GRASS GIS version: 7.8.6