grass icon indicating copy to clipboard operation
grass copied to clipboard

[Bug] Windows fails to parse string in i.sentinel.import

Open chaedri opened this issue 3 years ago • 0 comments

Describe the bug Windows 10 fails to parse string in pattern parameter of i.sentinel.import. For example:

gs.parse_command("i.sentinel.import", 
                 flags="p", 
                 input=path/to/data", 
                 pattern="B(02|03|04|08)_10m")

Raises error '03' is not recognized as an internal or external command, operable program or batch file.

To Reproduce Steps to reproduce the behavior:

  1. Download a sample of sentinel data from here and unzip it
  2. Install the i.sentinel.import addon
  3. Run the command above with the path to your downloaded and unzipped data
  4. See error

Expected behavior It should print a list of layers it is going to import.

System description (please complete the following information):

  • Operating System: Windows 10
  • GRASS GIS version: 8.3.dev

Additional context We've taken several steps to de-bug. We think the problem was in core.py. We figured out that kwargs["shell"] is never set and _escape_for_shell is never called. The whole __init__ runs without error.

The following command does work in a Jupyter cell and in the GUI console:

! i.sentinel.import -p input=sentinel pattern="B(02|03|04|08)_10m"

Using the i.sentinel.import GUI for the command also works fine.

Running the following in the GUI Python Editor results in the same error as above:

gs.parse_command("i.sentinel.import", 
                 flags="p", 
                 input=path/to/data", 
                 pattern="B(02|03|04|08)_10m")

chaedri avatar Aug 27 '22 13:08 chaedri