changeset: 81881:8f72519fd0e9 parent: 81873:249e0b47b686 parent: 81880:29e3aa7f2f4b user: Gregory P. Smith date: Fri Feb 01 13:10:33 2013 -0800 files: Misc/NEWS Modules/_io/textio.c description: Additional fix for issue #12268: The io module file object write methods no longer abort early when a write system call is interrupted (EINTR). diff -r 249e0b47b686 -r 8f72519fd0e9 Misc/NEWS --- a/Misc/NEWS Fri Feb 01 11:35:00 2013 -0800 +++ b/Misc/NEWS Fri Feb 01 13:10:33 2013 -0800 @@ -715,6 +715,12 @@ `sha3_256`, `sha3_384` and `sha3_512`. As part of the patch some common code was moved from _hashopenssl.c to hashlib.h. +Extension Modules +----------------- + +- Issue #12268: The io module file object write methods no longer abort early + when one of its write system calls is interrupted (EINTR). + Tests ----- diff -r 249e0b47b686 -r 8f72519fd0e9 Modules/_io/iobase.c --- a/Modules/_io/iobase.c Fri Feb 01 11:35:00 2013 -0800 +++ b/Modules/_io/iobase.c Fri Feb 01 13:10:33 2013 -0800 @@ -669,7 +669,10 @@ break; /* Stop Iteration */ } - res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); + res = NULL; + do { + res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); + } while (res == NULL && _PyIO_trap_eintr()); Py_DECREF(line); if (res == NULL) { Py_DECREF(iter); diff -r 249e0b47b686 -r 8f72519fd0e9 Modules/_io/textio.c --- a/Modules/_io/textio.c Fri Feb 01 11:35:00 2013 -0800 +++ b/Modules/_io/textio.c Fri Feb 01 13:10:33 2013 -0800 @@ -1247,8 +1247,11 @@ Py_DECREF(pending); if (b == NULL) return -1; - ret = PyObject_CallMethodObjArgs(self->buffer, - _PyIO_str_write, b, NULL); + ret = NULL; + do { + ret = PyObject_CallMethodObjArgs(self->buffer, + _PyIO_str_write, b, NULL); + } while (ret == NULL && _PyIO_trap_eintr()); Py_DECREF(b); if (ret == NULL) return -1;