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.

Title: add a flag that will not give the set a sys.stdin
Type: enhancement Stage: resolved
Components: Versions: Python 3.5
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, yuriy_levchenko
Priority: normal Keywords:

Created on 2016-03-04 16:46 by yuriy_levchenko, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg261191 - (view) Author: yuriy_levchenko (yuriy_levchenko) Date: 2016-03-04 16:46
i have Fatal Error 

"Py_Initialize: can't initialize sys standard streams"

because fail to create

fd = fileno(stdin);

std = create_stdio(iomod, fd, 0, "<stdin>", encoding, errors);

I do not need to create this input|output

if i comment this code, and setup 

__stdin__= None
__stdout__= None
__stderr__= None

all workin fine
msg342543 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-05-15 02:59
create_stdio() checks if the file descriptor is valid:

    if (!is_valid_fd(fd))

This function is_valid_fd() has been fixed recently on FreeBSD.

It's unclear to me why and how Python fails to create standard streams. Without more information, we cannot investigate. But since this issue has no activity for 3 years, I close. Reopen it if you still reproduce the issue and you can provide more information.

In the meanwhile, I suggest you to test the first alpha releases of Python 3.8.
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70667
2019-05-15 02:59:59vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg342543

resolution: out of date
stage: resolved
2016-03-04 16:55:06brett.cannonsettype: behavior -> enhancement
2016-03-04 16:46:28yuriy_levchenkosettype: behavior
2016-03-04 16:46:13yuriy_levchenkocreate