Skip to content

PyByteArray_Check(Long) crashes in Python 3.9 and 3.10 #124838

@juanjux

Description

@juanjux

Crash report

What happened?

TEST(PyByteArray_Check, WithNumber)
{
    PyObject* non_text_obj = PyLong_FromLong(42);
    EXPECT_FALSE(PyByteArray_Check(non_text_obj));
    Py_DecRef(non_text_obj);
}

This crashes (segmentation fault) for me on Python 3.9 and 3.10.15. Doesn't crash on 3.7, 3.8, 3.11 or 3.12.

CPython versions tested on:

3.8, 3.9

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-C-APItype-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