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
socket.fileno() documentation #63433
Comments
-------- Original-Nachricht -------- I might be wrong but in my opinion the socket library documentation is not In the Python 3.2 socket library documentation there is:
----- socket.close()
---- socket.fileno()
---- Based on the information quoted above, I wrote a test if a socket is active or try: But is doesn't work. I have found out that fileno() returns -1 on a closed It looks like a fileno's failure - unlike to getsockname's failure - is not |
See also bpo-19154. For consistency with the rest of Python it should probably raise ValueError. But at this point it has done what it does for a long time (which is to return what the underlying posix function returns), so we should probably just document it. |
Indeed, this should probably be documented as-is - or, if we want to change the behaviour, discussed on python-dev first. |
Adds more lines to explain the behavior of socket.fileno() in case of error. |
I think the additions are redundant; pick one or the other. The first should be sufficient. |
New changeset d83007ab69e2 by Kushal Das in branch '3.5': New changeset 3c745b656dca by Kushal Das in branch 'default': |
This looks fixed. |
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: