Repository navigation
Single-instance lock: catch only BlockingIOError and PermissionError - #1
Closed
TomHolzknecht wants to merge 4 commits into
Closed
TomHolzknecht wants to merge 4 commits into
TomHolzknecht wants to merge 4 commits into
Conversation
fcntl exists only on Linux and macOS. Import it inside the single-instance lock function and use msvcrt.locking on Windows. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Without sherpa-onnx the GUI shows "No module named 'sherpa_onnx'" when the Local provider is selected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The lock code caught every OSError and reported "Dictate is already running". An unwritable config folder gave the same misleading message. Now only the two lock-held errors count: BlockingIOError (flock on Linux/macOS) and PermissionError (msvcrt.locking on Windows). Other OSErrors propagate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
origin/main now has its own Windows support, including the msvcrt lock. Resolved: take main's docstring, core.IS_WINDOWS and README line. Keep this PR's one remaining change: the lock catches only BlockingIOError and PermissionError instead of every OSError. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
|
Thanks for the updates, I close this. |
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.
origin/mainnow has its own Windows support (commit 1faf9e2), including themsvcrtlock that this PR first added. After mergingmaininto this branch, one change is left.The single-instance lock caught every
OSErrorand then reported "already running". An unwritable config folder gave the same misleading result. Now it catches only the two lock-held errors:BlockingIOErrorfromflockon Linux and macOSPermissionErrorfrommsvcrt.lockingon Windows (errno 13)Other
OSErrors propagate.Tested on Windows 11 with two processes: the first instance gets the lock, the second is refused, and a third gets it after the first ends. Not run on Linux or macOS.
🤖 Generated with Claude Code