Paul Moore added the comment:

I'm still unsure whether this would be a good idea. On the plus side, it 
provides (in conjunction with the "embedded" distribution) a really good way of 
producing a standalone application on Windows. On the minus side there are some 
limitations which may trip up naive users:

* You can't put C extensions in a zipapp
* You have to take care with things like multiprocessing if you're using an 
embedded app.

And the wrapper's basically only 4 lines of code:

    wchar_t **myargv = _alloca((__argc + 2) * sizeof(wchar_t*));
    myargv[0] = __wargv[0];
    memcpy(myargv + 1, __wargv, (__argc + 1) * sizeof(wchar_t *));
    return Py_Main(__argc+1, myargv);

so it's not exactly rocket science. (By the way, the arguments to Py_Main are 
"exactly as those which are passed to a C program’s main" - IIRC, for a C 
program there's always a NULL pointer at the end of argv, does that rule apply 
to Py_Main, too? The code doesn't seem to rely on it, so I guess I could save a 
slot in the array above).

Maybe adding a section to the zipapp docs explaining how to make standalone 
applications would be a better way of handling this? That would have the 
advantage of being just as applicable to 3.6 (and 3.5, for that matter) at the 
cost of making users build their own wrapper (or find a published one).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28247>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to