mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
Merged revisions 84239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84239 | antoine.pitrou | 2010-08-21 21:09:32 +0200 (sam., 21 août 2010) | 4 lines Issue #9617: Signals received during a low-level write operation aren't ignored by the buffered IO layer anymore. ........
This commit is contained in:
parent
b7575ee2d3
commit
3ebaed60b4
3 changed files with 85 additions and 0 deletions
|
|
@ -1670,6 +1670,11 @@ _bufferedwriter_flush_unlocked(buffered *self, int restore_pos)
|
|||
self->write_pos += n;
|
||||
self->raw_pos = self->write_pos;
|
||||
written += Py_SAFE_DOWNCAST(n, Py_off_t, Py_ssize_t);
|
||||
/* Partial writes can return successfully when interrupted by a
|
||||
signal (see write(2)). We must run signal handlers before
|
||||
blocking another time, possibly indefinitely. */
|
||||
if (PyErr_CheckSignals() < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (restore_pos) {
|
||||
|
|
@ -1807,6 +1812,11 @@ bufferedwriter_write(buffered *self, PyObject *args)
|
|||
}
|
||||
written += n;
|
||||
remaining -= n;
|
||||
/* Partial writes can return successfully when interrupted by a
|
||||
signal (see write(2)). We must run signal handlers before
|
||||
blocking another time, possibly indefinitely. */
|
||||
if (PyErr_CheckSignals() < 0)
|
||||
goto error;
|
||||
}
|
||||
if (self->readable)
|
||||
_bufferedreader_reset_buf(self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue