-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
only use AI_ADDRCONFIG
when supported by getaddrinfo
#10542
Conversation
E.g. the fallback implementation for getaddrinfo in CPython doesn't support it and currently fails with a bad flags error
for more information, see https://pre-commit.ci
CodSpeed Performance ReportMerging #10542 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10542 +/- ##
==========================================
+ Coverage 98.69% 98.71% +0.01%
==========================================
Files 122 125 +3
Lines 37230 37370 +140
Branches 2064 2064
==========================================
+ Hits 36745 36888 +143
+ Misses 338 335 -3
Partials 147 147
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'm missing some context for this PR, as it looks like |
|
We need a changelog fragment for this change. As there's no linked issue, and this is outside of my expertise, I need a bit more context to understand what this is solving in order to suggest one. It would be helpful to provide a back trace of the current problem, as well as which system/platform it's happening on. |
I think what's meant here, is that the addrinfo.h file is only used if a system version or something isn't already included during compilation, presumably the __sgi variable here (whatever that is): It doesn't appear to be used on my Debian system:
So, on my system, this change will have no effect. |
Python uses getaddrinfo from one of two places:
These implementations don't all support the same flags. Some systems make the list of supported flags public via the The Python fallback implementation does provide
With this patch we stop using the flag in case We do use this fallback implementation in our PlayStation port of Cpython. With this patch we can use aiohttp on there without any problems. |
It's bound to |
Thanks for the additional context, I think this is good to go once we get a change fragment |
Do you have a suggestion for one? |
Fixed DNS resolution on platforms that don't support Something like that? |
for more information, see https://pre-commit.ci
Sorry if that came across in an incorrect way. Android provides |
Thanks @maxbachmann |
Backport to 3.11: 💚 backport PR created✅ Backport PR branch: Backported as #10578 🤖 @patchback |
The fallback implementation for getaddrinfo in CPython doesn't support `AI_ADDRCONFIG` and currently fails with a bad flags error. This changes the implementation to only set the flag if it's part of `AI_MASK`. Since `AI_MASK` isn't necessarily available either this has to be checked first. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <[email protected]> (cherry picked from commit e1d2d77)
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #10579 🤖 @patchback |
The fallback implementation for getaddrinfo in CPython doesn't support `AI_ADDRCONFIG` and currently fails with a bad flags error. This changes the implementation to only set the flag if it's part of `AI_MASK`. Since `AI_MASK` isn't necessarily available either this has to be checked first. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <[email protected]> (cherry picked from commit e1d2d77)
…ported by getaddrinfo (#10578)
…ported by getaddrinfo (#10579)
The fallback implementation for getaddrinfo in CPython doesn't support
AI_ADDRCONFIG
and currently fails with a bad flags error. This changes the implementation to only set the flag if it's part ofAI_MASK
. SinceAI_MASK
isn't necessarily available either this has to be checked first.