[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() {
    PyRun_SimpleString("import unittest");

    PyRun_SimpleString("import unittest");  /* segfault here */

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:

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>

More information about the New-bugs-announce mailing list