More gating around the new Daemon for Windows compatability#3127
Open
More gating around the new Daemon for Windows compatability#3127
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Windows compatibility for the Sanic daemon functionality by adding proper import guards around Unix-specific modules and defensive attribute access.
- Wrapped
grpandpwdimports in a try-except block to handle platforms where these modules are unavailable - Added defensive
getattrfor theunixCLI argument which is only defined on non-Windows platforms - Bumped version from 25.12.0 to 25.12.1
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sanic/worker/daemon.py | Added try-except import guards for Unix-specific grp and pwd modules, following the pattern used for fcntl |
| sanic/cli/app.py | Changed direct attribute access to getattr with default value for unix argument, which doesn't exist on Windows |
| sanic/version.py | Version bump to 25.12.1 for this patch release |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3127 +/- ##
=============================================
+ Coverage 87.793% 87.819% +0.026%
=============================================
Files 105 105
Lines 8143 8144 +1
Branches 1290 1290
=============================================
+ Hits 7149 7152 +3
+ Misses 687 686 -1
+ Partials 307 306 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3 tasks
Contributor
|
Could you improve CI to catch this errors early, before a release? |
10 tasks
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.
Fixes #3126