This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients martin.panter
Date 2016-10-15.01:31:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476495099.4.0.146030903407.issue28447@psf.upfronthosting.co.za>
In-reply-to
Content
The getpeername() method is just a wrapper around the OS function, so it is not going to work if the socket file descriptor is closed or invalid (-1).

You haven’t provided enough code or information for someone else to reproduce the problem. But it sounds like you may be closing the socket in one thread, and trying to use it in another thread. This is going to be unreliable and racy, depending on which thread acts on the socket first. Perhaps you should save the peer address in the same thread that closes it, so you can guarantee when it is open and when it is closed. Or use something else to synchronize the two threads and ensure the socket is always closed after getpeername() is called.

BTW it looks like I have to remove George’s username from the nosy list because it contains a comma!
History
Date User Action Args
2016-10-15 01:31:39martin.pantersetrecipients: + martin.panter
2016-10-15 01:31:39martin.pantersetmessageid: <1476495099.4.0.146030903407.issue28447@psf.upfronthosting.co.za>
2016-10-15 01:31:39martin.panterlinkissue28447 messages
2016-10-15 01:31:38martin.pantercreate