[issue26703] Socket state corrupts when original socket object goes out of scope in a different thread

2016-04-08 Thread JoshN
JoshN added the comment: Josh/Martin/Antoine: Thank you for the tips - I was not aware of the underlying mechanics, especially the separate abstraction layers. I did RTFM up and down before posting this, to be sure. My apologies for the inconvenience

[issue26703] Socket state corrupts when original socket object goes out of scope in a different thread

2016-04-06 Thread JoshN
JoshN added the comment: I do understand that the docs are a bit strange on the issue. For example, actually testing the line you referenced ("...fileno will return the same socket and not a duplicate.") by creating 2 sockets and testing sameness with the 'is' operator returns false

[issue26703] Socket state corrupts when original socket object goes out of scope in a different thread

2016-04-06 Thread JoshN
Changes by JoshN <cameronm...@gmail.com>: -- title: Socket state corrupts when original assignment goes out of scope -> Socket state corrupts when original socket object goes out of scope in a different thread ___ Python tra

[issue26703] Socket state corrupts when original assignment goes out of scope

2016-04-06 Thread JoshN
New submission from JoshN: Creating a socket in one thread and sharing it with another will cause the socket to corrupt as soon as the thread it was created in exits. Example code: import socket, threading, time, os def start(): a = socket.socket(socket.AF_INET, socket.SOCK_STREAM