Another problem(maybe) I found while boost.python deal with std::string: // my function void write1( std::string s ) { // no nothing } // my class to deal with python error output class Cout { public: std::string sbuf; public: void write( std::string s ) { sbuf += s; if ( sbuf.find_first_of( "\n" ) == std::string::npos ) return; printf( "Cout::write\t%s", sbuf.c_str() ); sbuf = ""; } }; I wrapped it by boost.python in my c++ program embedding boost.python, BOOST_PYTHON_MODULE(mym) { def( "write", &write1 ); class_<Cout>( "Cout", init<std::string>() ) .def_readwrite( "sbuf", &Cout::sbuf ) .def( "write", &Cout::write ) ; } and then I call it as following: PyRun_SimpleString( "import mym\n" "import sys\n" "sys.stderr = mym.Cout('')\n" "mym.write('aa','bb')\n" ); it crashed, I can't caught any exception, even I insert the contents of libs/python/test/module_tail.cpp into my program. Donnie Leen