Skip to content

Commit 9e86cb2

Browse files
fix: quoting for SLURM partition (#399)
Fixes TypeError when partition is an int. (TypeError: expected string or bytes-like object, got 'int' from shlex.quote()) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Safely handle SLURM partition inputs by converting non-string values to strings before quoting, preventing errors when users provide numeric or other non-string partition values and improving robustness of partition handling. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Christian Meesters <cmeesters@users.noreply.github.com>
1 parent a905182 commit 9e86cb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

snakemake_executor_plugin_slurm/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,8 @@ def get_partition_arg(self, job: JobExecutorInterface):
968968
if partition:
969969
# we have to quote the partition, because it might
970970
# contain build-in shell commands
971-
return f" -p {shlex.quote(partition)}"
971+
# string conversion needed for partition if partition is an integer
972+
return f" -p {shlex.quote(str(partition))}"
972973
else:
973974
return ""
974975

0 commit comments

Comments
 (0)