mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
This commit is contained in:
commit
990a5feba7
8 changed files with 295 additions and 15 deletions
|
@ -57,6 +57,11 @@ extern Py_ssize_t _PyIO_find_line_ending(
|
|||
int translated, int universal, PyObject *readnl,
|
||||
int kind, char *start, char *end, Py_ssize_t *consumed);
|
||||
|
||||
/* Return 1 if an EnvironmentError with errno == EINTR is set (and then
|
||||
clears the error indicator), 0 otherwise.
|
||||
Should only be called when PyErr_Occurred() is true.
|
||||
*/
|
||||
extern int _PyIO_trap_eintr(void);
|
||||
|
||||
#define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue