This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author p-ganssle
Recipients p-ganssle
Date 2019-02-11.18:15:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Just noticed this (tested on Python 3.7 and 3.8):

    mkdir /tmp/demo
    cd /tmp/demo
    cat << EOF >
    raise Exception("Hi")
    PYTHONPATH=: python -c ""

This will crash the interpreter with:

    Fatal Python error: init_sys_streams: can't initialize sys standard 
    Traceback (most recent call last):
      File ".../lib/python3.7/", line 52, in <module>
      File "/tmp/demo/", line 1, in <module>
    Exception: Hi
    Aborted (core dumped)

It seems that the problem is that the io module imports the abc module, which raises an exception, so io fails to load. Evidently the io module is necessary to load the interpreter, so the interpreter crashes.

Here's the backtrace for 3.7.2 on Arch Linux:

(gdb) bt
#0  0x00007f234b3f0d7f in raise () from /usr/lib/
#1  0x00007f234b3db672 in abort () from /usr/lib/
#2  0x00007f234b7db490 in fatal_error (prefix=prefix@entry=0x7f234b9d5fe0 <__func__.16645> "init_sys_streams", 
    msg=msg@entry=0x7f234ba01f60 "can't initialize sys standard streams", status=status@entry=-1)
    at Python/pylifecycle.c:2179
#3  0x00007f234b8460cb in _Py_FatalInitError (err=...) at Python/pylifecycle.c:2198
#4  0x00007f234b8495a9 in pymain_init (pymain=0x7fff971cca70) at Modules/main.c:3019
#5  0x0000555dfa560050 in ?? ()
#6  0x00007fff971ccbc0 in ?? ()
#7  0x0000000000000000 in ?? ()

I'm not sure if anything can or should be done about this. It's very fair for the interpreter to fail to start, though I would guess that it should do that without dumping a core.
Date User Action Args
2019-02-11 18:15:38p-gansslesetrecipients: + p-ganssle
2019-02-11 18:15:34p-gansslesetmessageid: <>
2019-02-11 18:15:34p-gansslelinkissue35969 messages
2019-02-11 18:15:34p-gansslecreate