New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Real argc and argv in embedded interpreter #59782
Comments
I have found out certain peculiarity of interpreter in case it is embedded. /* For Py_GetArgcArgv(); set by main() */
static char **orig_argv;
static int orig_argc; .......................................................................................... int
Py_Main(int argc, char **argv)
{
..........................................................................................
orig_argc = argc; /* For Py_GetArgcArgv() */
orig_argv = argv;
..........................................................................................
}
void
Py_GetArgcArgv(int *argc, char ***argv)
{
*argc = orig_argc;
*argv = orig_argv;
} Thats why I would like to suggest something similar to such function and use it in Py_Main and probably make it available from Python C API. void
Py_InitArgcArgv(int *argc, char ***argv)
{
if(! *argv) return -1;
return 0;
} Would like to see other suggestions. |
Without a patch this issue will go nowhere. I'm assuming that this limitation must have been overcome by other projects using embedded Python. Has anybody got any ideas as to how, I certainly haven't? |
I only saw one request (this issue) for this feature, in 2012. So it doesn't sound really important. I close the issue. |
FWIW, another project that needs Py_GetArgcArgv is "setproctitle": https://bugzilla.redhat.com/show_bug.cgi?id=1792059 See also: cherrypy/cherrypy#1506 |
Py_GetArgcArgv gone broke setproctitle indeed. Is there a way to get the same feature in 3.9 or should setproctitle become no-op from 3.9 on and Python loses this feature? Thank you. |
I mark this issue as a duplicate of bpo-23427. |
See also bpo-40910: "Py_GetArgcArgv() is no longer exported by the C API". |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: