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 vstinner
Recipients eamanu, p-ganssle, vstinner, xtreak
Date 2019-02-12.10:57:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549969024.39.0.683214130682.issue35969@roundup.psfhosted.org>
In-reply-to
Content
A workaround is the usage of -I option:

vstinner@apu$ PYTHONPATH=: python3 -c ""
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/lib64/python3.7/io.py", line 52, in <module>
  File "/tmp/demo/abc.py", line 1, in <module>
Exception: Hi
Aborted (core dumped)

vstinner@apu$ PYTHONPATH=: python3 -I -c ""
<it works as expected>

A long term solution would to enable -I behavior by default: don't add the current directory to sys.path when using -c CMD.
History
Date User Action Args
2019-02-12 10:57:04vstinnersetrecipients: + vstinner, p-ganssle, eamanu, xtreak
2019-02-12 10:57:04vstinnersetmessageid: <1549969024.39.0.683214130682.issue35969@roundup.psfhosted.org>
2019-02-12 10:57:04vstinnerlinkissue35969 messages
2019-02-12 10:57:04vstinnercreate