Skip to content

Add process crashes if it cannot find a shell #997

Description

@wk9874

Description of Bug

When running inside an apptainer on HPC via slurm, I get this error:

  File ".venv/lib64/python3.12/site-packages/simvue/run.py", line 998, in add_process
    self._executor.add_process(
  File ".venv/lib64/python3.12/site-packages/simvue/executor.py", line 311, in add_process
    command += self._kwarg_assembly(cmd_kwargs, executable=executable)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib64/python3.12/site-packages/simvue/executor.py", line 158, in _kwarg_assembly
    _shell_is_pwsh: bool = any(
                           ^^^^
  File ".venv/lib64/python3.12/site-packages/simvue/executor.py", line 159, in <genexpr>
    shell in get_current_shell() for shell in ("pwsh", "powershell")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

This is because get_current_shell returns str | None, but the None case is not handled inside the executor

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions