Repository navigation
Fix: device-send.py works on Windows paths with spaces - #2697
Open
jonathanwardle1992-beep wants to merge 1 commit into
Open
jonathanwardle1992-beep wants to merge 1 commit into
jonathanwardle1992-beep wants to merge 1 commit into
Conversation
On Windows os.execv joins its arguments unquoted, so a Node or repository path with a space reached Node split in two. Start the unit queue with subprocess there and exit with its code; POSIX keeps execv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: jonathanwardle1992 <jonathanwardle1992@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
scripts/device-send.pynow works on Windows when Node or the repository sits in a folder whose name contains a space. Before this fix, any line that drives the unit stopped before reaching the queue. Nothing changes on macOS or Linux, and nothing changes for musicians.MODWERK_UNIT_TURNunset, the script runs itself again inside the unit queue withos.execv. On Windowsos.execvjoins its arguments without quoting them, so a Node path likeC:\Users\Jo Doe\AppData\Local\nvm\…\node.EXEreached Node split in two. It failed withCannot find module 'C:\…\Doe\AppData\Local\nvm\…\node.EXE'. This came up while testing a module on an Octatrack from a Windows user folder with a space. The workaround was to callnode scripts/unit-queue.mjs run … -- python -B scripts/device-send.py LINEby hand.subprocess.Popen(list form, so each argument is quoted) and exits with the queue's code. Ctrl+C is left to the queue, which also receives it and rolls back in its own time; the script doesn't kill it. POSIX keepsos.execv.scripts/device-send.test.mjscopies the script into a folder with spaces next to a stubunit-queue.mjs. The stub echoes its arguments and exits 3. The test checks that the line, the script path and a quoted argument arrive intact and that the exit code comes back. On Windows (Node 24.22, Python 3) it fails onmainwith the exactCannot find moduleerror and passes with this change.npm run pr:readyon this Windows machine:modules:compatneededPYTHONUTF8=1, a separate Windows encoding issue. The vitest run shows 128 Windows-only failures in files this PR doesn't touch, such as the device MCP,check.test.tsand the test procedure. CI on Linux is the gate. The assigned agent replay was completed.unit-queue.mjs runworkaround during Micro Timing: list 0.1.1-experimental (unit bss) #2193 testing.🤖 Generated with Claude Code