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
misleading comment in socket.gethostname() documentation #49876
Comments
The documentation for socket.gethostname() contains the following "If you want to know the current machine’s IP address, you may want to This comment leads to the mistaken assumption that a machine has only |
Python doesn't currently have any sort of function for fetching all a computer's IPs, as far as I know, but if there is one (either now or in the future), it would be good to link to that from there. "Here's how to get your host name. And if you're interested, over there is how to get your IP addresses." Otherwise, removing the potentially-misleading information (this is going to return something in 127.0.0.0/8 for a lot of systems) seems the reasonable option. |
Given that we have not received any more reports on users tripping up on this message, it seems to me that we could just ignore this report and close it. Thoughts? |
The point still stands that speaking of "the current machine's IP address" is misleading at best. I'd say either apply Berker's suggested patch or expand the description to better reflect the real world of multiple interfaces. Of course I'm biased. |
I agree with Chris and Ned. I will apply issue5626_v1.diff today. |
New changeset e1a711808cfe by Berker Peksag in branch '3.5': New changeset 689f881dd5d1 by Berker Peksag in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: