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
Fix for 926423: socket timeouts + Ctrl-C don't play nice #41443
Comments
Please have a close look at the attached patch. A few remarks:
|
Logged In: YES Thanks for the patch.
|
Logged In: YES Martin, I'm working on an update to this patch so that it BTW, I'm handling #1 (internal_connect()). There is still |
Logged In: YES If I understand correctly, you have Py_END_ALLOW_THREADS It may well be that the same mistake is made in other In general, you should assume that any C library call may |
Logged In: YES Hmm, not me, but yes, socketmodule.c wraps its system calls static PyObject *
sock_connect(PySocketSockObject *s, PyObject *addro)
{
struct sockaddr *addr;
int addrlen;
int res;
int timeout;
if (timeout) {
PyErr_SetString(socket_timeout, "timed out");
return NULL;
}
if (res != 0)
return s->errorhandler();
Py_INCREF(Py_None);
return Py_None;
} Note that both the check for timeout and also the Do you have an example of a properly-coded module? For |
Logged In: YES Ehh, we can stop worrying. From ceval.h: "For convenience, that the value of 'errno' is restored This means that I can remove from my patch the extra code to |
Logged In: YES I've submitted a new patch as 1519025. |
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: