-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-111995: Add getnameinfo extension flag #111994
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
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
78ef4a7
to
aa32d0d
Compare
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Modules/addrinfo.h
Outdated
@@ -119,6 +119,7 @@ | |||
#define NI_NAMEREQD 0x00000004 | |||
#define NI_NUMERICSERV 0x00000008 | |||
#define NI_DGRAM 0x00000010 | |||
#define NI_IDN 0x00000020 |
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.
This header defines the interface of the getnameinfo implementation in getaddrinfo.c in the same folder, which doesn't support NI_IDN. This implementation is only used on platforms where no suitable getaddrinfo is available in the system.
Therefore adding NI_IDN to this header is not needed.
Let me know if there's anything I can do so that we have NI_IDN on Linux. |
Please address my comment about the There also needs to be a versionadded in the block below the text mentioning In general I'd ask for a test for this as well, but it looks like other flags aren't tested as well and this is a pretty thin layer for a C API. @gpshead : What's your opinion on new tests for adding a new NI_* constant? |
bacdec5
to
0dee9f4
Compare
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
I wouldn't worry about a test for this. it's just trivially exposing a C constant/define. I'll take care of a news entry and merge this. For use on older versions of CPython the usual applies for any missing constant definitions: Look up the value from C on your target platforms and hard code that as a |
Add getnameinfo extension NI_IDN flag.
Add getnameinfo extension NI_IDN flag.
This PR adds the
NI_IDN
getnameinfo
extension flag.See: https://man7.org/linux/man-pages/man3/getnameinfo.3.html
The other two flags (
NI_IDN_ALLOW_UNASSIGNED
,NI_IDN_USE_STD3_ASCII_RULES
) are deprecated and I deliberately did not include them in the patch.Fixes #111995.