
On Sat, Aug 14, 2010 at 4:51 PM, David Abrahams
At Fri, 13 Aug 2010 09:25:22 -0500, Brian Ray wrote:
that they are all linking to the correct location. Why does it convert the const char * to a str in the first place. ^^^^^
So that it can call Python's import function.
Seems to be thrashing around a bit.
-- Brian
/// contents of boost_python_issue.cpp #include
using namespace boost::python; int main(int argc, char **argv) { Py_Initialize(); try { PyRun_SimpleString("import sys"); // This raises exception object sys = import("sys"); } catch (boost::python::error_already_set) { PyErr_Print(); } Py_Finalize(); }
Hmm, looks simple enough.
Output from gdb:
(gdb) boost::python::import (name=@0x7fff5fbff690) at libs/python/src/import.cpp:19 19 char *n = python::extract
(name); This is where the bug is (in Boost.Python). One should never try to extract a pointer to non-const char from a str. Could you try the enclosed patch and see if your problem is fixed?
Yes, applying this patch to the 1.43 release fixes the problem. Dave, can this patch be applied to version control head if it has not been already? -- Brian Ray