fix(capture): use platform-appropriate cmdline quoting for child app args#258
Conversation
…args shlex.join produces POSIX single-quote quoting which Win32 CommandLineToArgvW does not understand. Route both call sites through _platform.join_cmdline, which dispatches to subprocess.list2cmdline on Windows and shlex.join on POSIX.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Warning Review limit reached
More reviews will be available in 49 minutes and 34 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Closes #257.
Problem
rdc capture -- <exe> <args>built the child command line with POSIXshlex.join, which single-quotes any argument containing a backslash. On Windows,ExecuteAndInjectdelegates toCommandLineToArgvW, which does not recognise POSIX single-quoting, so a path likeD:\path\script.dasreached the target process as the literal'D:\path\script.das'and the launch failed.Fix
Add
join_cmdline(args)tordc._platform, dispatching on the existing_WINflag:subprocess.list2cmdline(the reference encoder thatCommandLineToArgvWparses back).shlex.join(unchanged behaviour).Both call sites in
commands/capture.pyare rerouted; the now-unusedshleximport is removed. The remote path forwards a single verbatim string and is correctly out of scope.Tests
tests/unit/test_platform.py::TestJoinCmdline(6 cases) covers both branches, including the regression: a backslash path is not single-quoted on Windows.pixi run lint && pixi run typecheck && pixi run test: all green (2996 passed, 6 skipped, 92.82% coverage).