Created on 2009-03-31 16:02 by ned.deily, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Files |
|
|
|
File name |
Uploaded |
Description |
Edit |
issue5626_v1.diff |
berker.peksag,2012-03-01 16:44 |
Remove misleading comment. |
review |
Messages (6) |
|
|
msg84816 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2009-03-31 16:02 |
The documentation for socket.gethostname() contains the following comment: "If you want to know the current machine’s IP address, you may want to use gethostbyname(gethostname()). This operation assumes that there is a valid address-to-host mapping for the host, and the assumption does not always hold." This comment leads to the mistaken assumption that a machine has only one IP address, an assumption which results in bugs such as in Issue5625. The comment also does not deal with other address families, i.e. IPv6 addresses. Either the paragraph should be expanded to cover multiple addresses and families, requiring the use of other socket functions, or the paragraph should simply be removed. |
|
|
msg212554 - (view) |
Author: Chris Angelico (Rosuav) * |
Date: 2014-03-02 14:39 |
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. |
|
|
msg258565 - (view) |
Author: Senthil Kumaran (orsenthil) *  |
Date: 2016-01-19 01:16 |
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? |
|
|
msg258567 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2016-01-19 01:52 |
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. |
|
|
msg258601 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-01-19 15:23 |
I agree with Chris and Ned. I will apply issue5626_v1.diff today. |
|
|
msg258649 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-01-20 06:46 |
New changeset e1a711808cfe by Berker Peksag in branch '3.5': Issue #5626: Remove misleading comment from socket.gethostname() documentation https://hg.python.org/cpython/rev/e1a711808cfe New changeset 689f881dd5d1 by Berker Peksag in branch 'default': Issue #5626: Remove misleading comment from socket.gethostname() documentation https://hg.python.org/cpython/rev/689f881dd5d1 |
|
|
History |
|
|
|
Date |
User |
Action |
Args |
2022-04-11 14:56:47 |
admin |
set |
github: 49876 |
2016-01-20 06:46:38 |
berker.peksag |
set |
status: open -> closedresolution: fixedstage: commit review -> resolved |
2016-01-20 06:46:01 |
python-dev |
set |
nosy: + python-devmessages: + |
2016-01-19 15:23:02 |
berker.peksag |
set |
type: behaviorstage: commit reviewmessages: + versions: + Python 3.5, Python 3.6, - Python 2.6, Python 3.0, Python 3.1 |
2016-01-19 01:52:09 |
ned.deily |
set |
messages: + |
2016-01-19 01:16:42 |
orsenthil |
set |
nosy: + orsenthilmessages: + |
2014-03-02 14:39:26 |
Rosuav |
set |
nosy: + Rosuavmessages: + |
2012-03-01 16:44:33 |
berker.peksag |
set |
nosy: + berker.peksag |
2012-03-01 16:44:15 |
berker.peksag |
set |
files: + issue5626_v1.diffkeywords: + patch |
2010-07-31 15:48:13 |
BreamoreBoy |
set |
assignee: georg.brandl -> docs@pythonnosy: + docs@python |
2009-03-31 16:02:52 |
ned.deily |
create |
|