[PyQt] pyqtdeployed app crashes android but not iOS

lloyd konneker bootch at nc.rr.com
Fri Feb 6 15:19:50 GMT 2015

(This post is out of order:  I sent it to the wrong list.  See my earlier post for a workaround for the problem which this post describes.)

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;
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150206/0f09f657/attachment.html>

More information about the PyQt mailing list