[Python-Dev] Suggested PySys_SetArgv use with a (char **) argv ?

Campbell Barton ideasman42 at gmail.com
Tue Jul 7 19:38:05 CEST 2009


In Python3 PySys_SetArgv takes (wchar_t **) for the argv, I looked
into converting a (char **) into a (wchar_t **) and while its possible
its lengthy enough not to be trivial, see python.c:18 - char2wcharm(),
its 102 lines with ifdef's and goto's, not including the loop lower
down that loops over the argv.

Looking further python has a very similar function for
./PC/bdist_wininst/install.c, for do_run_installscript  -
widen_string().

Since many C applications take argv as a (char **) it seems reasonable
for python to keep a function for the C api that accepts a  (char **)
argument for argv.
otherwise each C applications that embeds python will need to write
their own conversion function.

also noticed Demo/embed/demo.c is out of date, giving (char **) to
PySys_SetArgv().
-- 
- Campbell


More information about the Python-Dev mailing list