[New-bugs-announce] [issue40965] Segfault when importing unittest module

The Comet report at bugs.python.org
Fri Jun 12 22:29:55 EDT 2020


New submission from The Comet <megamashmothers at gmail.com>:

The following program will segfault the interpreter:

#include <Python.h>
int main() {
    Py_Initialize();
    PyRun_SimpleString("import unittest");
    Py_Finalize();

    Py_Initialize();
    PyRun_SimpleString("import unittest");  /* segfault here */
    Py_Finalize();
}

This only seems to happen with the unittest module. This is something that used to work but broke somewhere between python 3.7 and 3.8.

The code above can also be found on github as a cmake project for your convenience:
https://github.com/TheComet/python3.8-unittest-broken

----------
messages: 371432
nosy: The Comet
priority: normal
severity: normal
status: open
title: Segfault when importing unittest module
type: crash
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40965>
_______________________________________


More information about the New-bugs-announce mailing list