refactor: reduce subprocess shell=True usage with Windows fallback #659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What is this PR
Why is this PR needed?
Some subprocess calls in the rclone utilities relied on shell=True, which has security and portability implications and can behave inconsistently across platforms, especially on Windows. Issue #639 recommends reducing the use of shell=True where possible and handling platform-specific requirements explicitly.
What does this PR do?
Refactors rclone-related subprocess calls to prefer argument-list execution (shell=False)
Adds explicit Windows-only fallbacks to shell=True where PATH resolution requires a shell
Preserves existing behavior while improving safety and clarity
Does not introduce any user-facing or API changes
References
shell=False#639How has this PR been tested?
Ran pytest locally on Windows.
Test collection and unit tests run successfully.
Integration and TUI tests requiring rclone fail locally due to missing rclone installation and Textual environment differences on Windows.
No test behavior was modified; CI is expected to validate rclone-dependent tests.
Is this a breaking change?
No.
This PR does not break any existing functionality and only refactors internal subprocess execution.
Does this PR require an update to the documentation?
No.
There are no user-facing changes that require documentation updates.
Checklist: