-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_socket.py: fix for systems where AI_NUMERICSERV is not defined #3135
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3135 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 122 122
Lines 18357 18358 +1
Branches 1221 1221
=======================================
+ Hits 18289 18290 +1
Misses 47 47
Partials 21 21
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but needs newsfragment (that is why continuous integration is failing). newsfragments
folder's README file has more information.
@CoolCat467 That one CI which fails is unrelated, right? |
Docs are failing because your newsfragment is using markdown not rST. Try doing It's a bit confusing because the logs show two warnings, but the one you should care about is:
I don't think the other one makes it fail, though I may be wrong. |
641c0df
to
36a3de8
Compare
src/trio/_socket.py
Outdated
_NUMERIC_ONLY = _stdlib_socket.AI_NUMERICHOST | _stdlib_socket.AI_NUMERICSERV | ||
_NUMERIC_ONLY = _stdlib_socket.AI_NUMERICHOST | ||
_NUMERIC_ONLY |= getattr(_stdlib_socket, "AI_NUMERICSERV", 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps good to add a comment explaining why this is needed / when the workaround can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the original issue, what we have learned so far is that it doesn't exist in MacOS 10.6 on PowerPC. Not sure immediately what version that changed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CoolCat467 It does not exist on any macOS on any arch before 10.6 release. In practice, this will mostly be 10.5 and 10.4, on ppc and i386. (I.e. the fix has nothing to do with the architecture, it is only dependent on SDK.)
36a3de8
to
5260922
Compare
# AI_NUMERICSERV may be missing on some older platforms, so use it when available. | ||
_NUMERIC_ONLY = _stdlib_socket.AI_NUMERICHOST | ||
_NUMERIC_ONLY |= getattr(_stdlib_socket, "AI_NUMERICSERV", 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to be a bit more specific here, otherwise future people that stumble on this comment will have to do a bunch of research to figure out why/when it might be missing. And as I said in the issue, perhaps even a note on why it's needed despite being deprecated since a decade+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just linking the issue will work? That has info.
Rationale: on some platforms
AI_NUMERICSERV
may not be defined. In particular, old versions of macOS, possibly some other. While affected users are probably few, it is a trivial fix, which makestrio
usable (for example,yewtube
app works then).Credits to @CoolCat467
Closes: #3133