-
Notifications
You must be signed in to change notification settings - Fork 43
fix: quoting piped substring with shlex #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded shell command argument quoting using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
snakemake_executor_plugin_slurm/job_status_query.py (1)
146-155: Quoting is stripped byshlex.split/join, so|is still interpreted by the shell.
format_argis quoted, butquery_command = " ".join(shlex.split(...))removes those quotes, producing--format=%i|%Tagain. If this string is executed withshell=True, the pipe still acts as a pipeline and the fix won’t work.✅ Proposed fix (preserve quoting during normalization)
- query_command = " ".join(shlex.split(query_command)) + query_command = " ".join( + shlex.quote(arg) for arg in shlex.split(query_command) + )
🤖 I have created a release *beep* *boop* --- ## [2.2.0](v2.1.0...v2.2.0) (2026-02-09) ### Features * job name prefix ([#408](#408)) ([5fa0d33](5fa0d33)) ### Bug Fixes * cancel on multicluster ([#401](#401)) ([cb6124b](cb6124b)) * decreasing job query verbosity ([#405](#405)) ([6649881](6649881)) * extracting job id from convoluted output, if necessary ([#375](#375)) ([950c909](950c909)) * quoting piped substring with shlex ([#402](#402)) ([7aa7fc3](7aa7fc3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added job name prefix capability. * **Bug Fixes** * Fixed cancel operation on multicluster environments. * Improved job query verbosity output. * Fixed job ID extraction from complex output formats. * Fixed substring quoting in piped commands. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
The substring
"%i|%T"is now quoted withshlex.quote. This ensures that it will work on any standard shell and should fix issue #395.Summary by CodeRabbit
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.