-
-
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 |
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: