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 vstinner
Recipients gregory.p.smith, mcjeff, vstinner
Date 2015-04-09.08:44:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
socket_eintr.2.patch has an issue with timeout.

socket_eintr.2.patch retries a socket method when it is interrupted, but it doesn't recompute the timeout. If a program is interrupted every second by a signal, the signal handler doesn't raise an exception and the socket has a timeout longer than 1 second, the socket method will "hang".

Internally, socket method uses select() using the socket timeout. I had to modify deeply the socket module to handle correctly EINTR and respect the timeout in Python 3.5. By the way, I changed the behaviour of socket.sendall(), the timeout is now more strict (it's now the maximum total duration, the timeout is no reset each time some bytes are sent).

Since Python applications of the last 20 years already had to handle EINTR theirself, it's maybe safer to leave Python 2.7 with its bugs and let application developers workaround them? Anyway, if you have to handle EINTR in your application, you will have to handle EINTR explicitly to support Python 2.7.9 and older, no? It's hard to require an exact minor version on all platforms.

The PEP 475 is wider than just the socket module:

Impacted Python modules: io, os, select, socket, time. (Python 2.7 don't have faulthandler and don't have signal.sigtimedwait() nor signal.sigwaitinfo() functions, so faulthandler and signal are not impacted in Python 2.7.)

Do you want to fix all these modules?
Date User Action Args
2015-04-09 08:44:08vstinnersetrecipients: + vstinner, gregory.p.smith, mcjeff
2015-04-09 08:44:08vstinnersetmessageid: <>
2015-04-09 08:44:08vstinnerlinkissue23863 messages
2015-04-09 08:44:07vstinnercreate