Message304260
> The falling back to read() was implemented in issue12591. What methods still require read1()?
I read the Python implementation of TextIOWrapper in _pyio:
* seek() calls buffer.read() "if chars_to_skip:"... not sure that it can happen if buffer is a FileIO?
* read(None) and read(-1) to read "everything" (until EOF): buffer.read()
It seems like read(None) also calls buffer.read() in the C implementation, _io_TextIOWrapper_read_impl():
/* Read everything */
PyObject *bytes = _PyObject_CallMethodId(self->buffer, &PyId_read, NULL);
PyObject *decoded;
if (bytes == NULL)
goto fail;
and in _io_TextIOWrapper_seek_impl():
/* Just like _read_chunk, feed the decoder and save a snapshot. */
PyObject *input_chunk = _PyObject_CallMethodId(
self->buffer, &PyId_read, "i", cookie.bytes_to_feed); |
|
Date |
User |
Action |
Args |
2017-10-12 15:46:21 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka |
2017-10-12 15:46:21 | vstinner | set | messageid: <1507823181.83.0.213398074469.issue31775@psf.upfronthosting.co.za> |
2017-10-12 15:46:21 | vstinner | link | issue31775 messages |
2017-10-12 15:46:21 | vstinner | create | |
|