Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Open
Description
Bug report
Bug description:
Bug report
Bug description:
InModules/_io/bufferedio.c, thebuffered_iternext function has a fast path that calls_buffered_readline directly to avoid method call overhead.
However, due to an incorrect type check, this fast path is never executed.
tp=Py_TYPE(self);if (Py_IS_TYPE(tp,state->PyBufferedReader_Type)||Py_IS_TYPE(tp,state->PyBufferedRandom_Type))
becausePy_IS_TYPE will callPy_TYPE internally, will cause Py_TYPE(Py_TYPE(ob)) == type,<class 'type'> != state->PyBufferedReader_Type
All iteration over buffered binary files is affected:
withopen('data.txt','rb')asf:forlineinf:process(line)
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux