You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
We are facing an issue in our project while using go-python package.
It seems something related to python version and compatibility with go-python package. (python version is 2.7.10)
Issue Description
To simulate the issue I have python written as below
void Py_Initialize()
Initialize the Python interpreter. In an application embedding Python, this should be
called before using any other Python/C API functions; with the exception of
Py_SetProgramName(), Py_SetPythonHome(), PyEval_InitThreads(), PyEval_ReleaseLock(),
and PyEval_AcquireLock().
This initializes the table of loaded modules (sys.modules), and creates the fundamental
modules __builtin__, __main__ and sys. It also initializes the module search path (sys.path).
It does not set sys.argv; use PySys_SetArgvEx() for that.
This is a no-op when called for a second time (without calling Py_Finalize() first).
There is no return value; it is a fatal error if the initialization fails.
Thanks Sebastien for detailed explanation.
Now how should we go around this?
Should we invoke PySys_SetArgvEx() explicitly while initialize? Do we need
to do any cleanup after each pyhon call or once calling PySys_SetArgvEx()
while initialize is sufficient?
Initialize the Python interpreter. In an application embedding Python, this should be
called before using any other Python/C API functions; with the exception of
Py_SetProgramName(), Py_SetPythonHome(), PyEval_InitThreads(), PyEval_ReleaseLock(),
and PyEval_AcquireLock().
This initializes the table of loaded modules (sys.modules), and creates the fundamental
modules builtin, main and sys. It also initializes the module search path (sys.path).
It does not set sys.argv; use PySys_SetArgvEx() for that.
This is a no-op when called for a second time (without calling Py_Finalize() first).
There is no return value; it is a fatal error if the initialization fails.
—
Reply to this email directly or view it on GitHub #36 (comment).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We are facing an issue in our project while using go-python package.
It seems something related to python version and compatibility with go-python package. (python version is 2.7.10)
Issue Description
To simulate the issue I have python written as below
This python if I run from python CLI works fine as shown below
Now I have go program to invoke the same function PrintSysArgv as below
Below is the snippet of gopy wrapper I am using in above go source
The out of the execution of go program fails python side as shown below
Just a wierd thought that go-python uses a trimmed version of python which is not able to take care of "sys.argv" as such.
Can you please look into the same and suggest us accordingly.
If needed / suggested I can raise the same in wiki...
Thanks and Regards,
Shubhendu
The text was updated successfully, but these errors were encountered: