The Boost libraries in their test jigs use a mixture of an embedded API and direct access to the methods in Python.h. Below is an example which compiles with the py3.5 branch, correctly prints “hello world” but then faults with an message: “Invalid RPython operation (NULL ptr or bad array index)”. Is this kind of mixing of the two interfaces supported? Thanks --david #include <Python.h> #include <PyPy.h> #include <assert.h> int main() { rpython_startup_code(); int err = pypy_setup_home((char*)"/home/dcallahan/local/pypy", /*verbbose*/1); pypy_execute_source("print('hello world')"); const char *s = "'abcdefg'.upper()"; PyObject *obj = ::PyUnicode_FromString(s); return 0; }
Hi David, On 10 August 2017 at 19:21, David Callahan <dcallahan@fb.com> wrote:
The Boost libraries in their test jigs use a mixture of an embedded API and direct access to the methods in Python.h.
Below is an example which compiles with the py3.5 branch, correctly prints “hello world” but then faults with an message:
“Invalid RPython operation (NULL ptr or bad array index)”.
Is this kind of mixing of the two interfaces supported?
No. Our cpyext emulates the C API but doesn't support the embedding mode of CPython. A bientôt, Armin.
participants (2)
-
Armin Rigo
-
David Callahan