Skip to content

Assertion failure in Modules/_io/textio.c _io_TextIOWrapper_tell_impl: Assertion 'skip_back <= PyBytes_GET_SIZE(next_input)' failed #141314

Description

@YuanchengJiang

Bug report

Bug description:

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)

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtopic-IOtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions