-
-
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
AttributeError: module 'socket' has no attribute 'AI_NUMERICSERV'. Did you mean: 'NI_NUMERICSERV'?
#3133
Comments
I am curious about what platform you are running Python under. Looks like MacOS at first glance, but full details would be helpful. Is there another module named |
Yeah, that is MacOS, but a pretty old one, a developer build of 10.6 on powerpc ) (I am not really sure re other modules with Simply deleting |
Kind of, in Python you would do something like this: _NUMERIC_ONLY = _stdlib_socket.AI_NUMERICHOST
_NUMERIC_ONLY |= getattr(_stdlib_socket, "AI_NUMERICSERV", 0) where it tries to get attribute It might not be safe to do so, but you could also replace |
@CoolCat467 Awesome, this works. Could we fix this in the master? I can make a PR referring to you. |
Sure, I don't see why not |
Heh, looking this up I find nodejs/node-v0.x-archive#6. Seems defaulting to 0 is OK |
@A5rocks It has been used in a number of projects. For example, in MPICH's |
Looking it up more, these versions look absolutely ancient? 10.5 ended support in 2012 and 10.6 ended support in 2014. We generally don't care to support systems that old, and if I'd seen a fix in the codebase for a system with 10+ year since EOL I would probably vote for its removal. So I'm somewhat confused why you need to support such an old SDK, and that other programs are working. You might be better off with something like https://github.com/macports/macports-legacy-support to patch the C libraries themself. It's not a big problem doing a |
@jakkdl Well, first of all it is just the right thing to do, when a flag is not universally supported. While my motivation is macOS, it is pretty likely other platforms are affected too, even though such may be very few. When it is about a single line of code, the cost of having a better code is zero. Secondly, there are a lot of people using those legacy macOS, since those are the last to run on PowerPC hardware. You could check activity on MacRumors subforum for PowerPC Macs, for example, as an evidence. Specifically P. S. Going with |
It's always tricky to try and support a system that is not tested in CI, and none of the regular developers have access to such a system. When it only is a one-liner with ~zero cost it's probably fine, but I think that's an exception rather than the rule. The cost is primarily for readers and maintainers of the code, any time somebody in the future wants to use We might be helping two dozen users, but inconveniencing several dozen readers of the source code. But mostly I want to make sure this doesn't set a precedent where somebody pops in a month from now saying "look you support PowerPC, clearly you should support as well". Or that issues gets opened in every large open-source library requesting support for PowerPC (maybe citing Trio support it as a precedent). When you run a system that doesn't have official support, the primary responsibility is on you to modify your environment. Be that creating a fork, or doing a In the extreme case there's lots of examples of great projects stalling because they insist on extreme backwards compatibility, e.g. https://en.wikipedia.org/wiki/Mpv_(media_player), and I have lots of opinions on C/C++, but that's for another day :) |
AI_NUMERICSERV
may not be defined on a given platform. However it is used unconditionally, which fails in that case.Example of the problem:
In C code this works fine:
What can be done here?
The text was updated successfully, but these errors were encountered: