-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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 close() hangs client if used without prior shutdown() #43559
Comments
In Python 2.5b1, when closing a client socket using But I think this shutdown() should not be mandatory? At Sample code attached. Run the script and connect to |
Logged In: YES Oops forgot to mention: Tested with Python2.5b1 (official |
Logged In: YES Shutdown should not be mandatory. I can reproduce the same behaviour under linux. This is new |
Logged In: YES The problem is that _socketobject.close fails to set The real problem seems to me that close relies on Also, a test case should be added that the socket object native_socket = s._sock
s.close()
assert sys.getrefcount(native_socket) == 2 |
Logged In: YES The attached patch fixes the problem for me. It includes a It could be augmented with Martin's suggestion to check the |
Logged In: YES The patch fixes the problem for me too, on NetBSD 3.0, revision 47189. Thanks, Matt |
Logged In: YES I committed this as r47190. Adding my test is pointless in The refcount test would have been useful if there was an |
Logged In: YES I updated to latest svn and my code works again now. |
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: