I have determined that it fails here in pythonrun.c in function initstdio():

    fd = fileno(stdin);
    /* Under some conditions stdin, stdout and stderr may not be connected
     * and fileno() may point to an invalid file descriptor. For example
     * GUI apps don't have valid standard streams by default.
     */
    if (!is_valid_fd(fd)) {
        std = Py_None;
        Py_INCREF(std);
    }
    else {
       std = create_stdio(iomod, fd, 0, "<stdin>", encoding, errors);
       if (std == NULL) {  << this is true and it proceeds to return an error 
and abort

I haven’t determined yet why create_stdio fails, or why fileno(stdin) returns a 
valid fd if there is no stdin for the process on Android?

I don’t understand the rationale here: why every process should have a stdin 
and why the Python interpreter needs to initialize it (especially on Android 
with PyQt.)

One comment in the discussion of Python issue 17797 says a workaround is to 
redirect stdio to a file before calling Py_InitializeEx (and thus initstdio() )

Note that issue 17797 has recent comments in the last few days.  The thread 
says any ‘fix’ for Python (at least in regards Windows VS11 as a culprit) must 
wait till Python3.5.  The pertinent code in Python seems to have been changed 
recently.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to