importioimportosfromtest.supportimportos_helperDATA_TEMPLATE= ['line1=1']
DATA_CR=r'\n\r\t'.join(DATA_TEMPLATE) +'\r'open_func=io.openREADMODE='r'WRITEMODE='wb'data=DATA_CRif'b'inWRITEMODE:
data=data.encode('ascii')
withopen_func(os_helper.TESTFN, WRITEMODE) asfp:
fp.write(data)
withopen_func(os_helper.TESTFN, READMODE) asfp:
_=fp.readline()
pos=fp.tell()python: ../Modules/_io/textio.c:2848: _io_TextIOWrapper_tell_impl: Assertion `skip_back <= PyBytes_GET_SIZE(next_input)' failed.
Aborted (core dumped)
Bug report
Bug description:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs