Skip to content

Commit 69d4351

Browse files
committed
fix: quoting piped substring with shlex
1 parent 5250260 commit 69d4351

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

snakemake_executor_plugin_slurm/job_status_query.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ def query_job_status_squeue(runid) -> list:
143143
Dictionary mapping job ID to JobStatus object
144144
"""
145145
# Build squeue command
146+
# Note: The format string contains a pipe '|' which must be quoted to
147+
# prevent shell interpretation when passing to subprocess with shell=True
148+
format_arg = shlex.quote("%i|%T")
146149
query_command = f"""squeue
147-
--format=%i|%T
150+
--format={format_arg}
148151
--states=all
149152
--noheader
150153
--name {runid}"""

0 commit comments

Comments
 (0)