id summary reporter owner description type status milestone component version severity resolution keywords cc 2016 wrong default arguments in boost/python/exec.hpp schlotz Dave Abrahams "Calling boost::python::exec, exec_file and eval without the second and third argument, makes the default arguments create 'object's where 'dict's are neccessary. Consider this program: {{{ #include int main() { using namespace boost::python; Py_Initialize(); try { object foo = exec(""a=5; print(a);""); } catch(error_already_set const &) { PyErr_Print(); } return 0; } }}} Expected output: {{{ 5 }}} Real output: {{{ Traceback (most recent call last): File """", line 1, in TypeError: 'NoneType' object does not support item assignment }}} A possible fix is to change the default arguments to exec, exec_file and eval in exec.hpp from ...=object() to ...=dict(), see the attached patch to boost/python/exec.hpp I'm not sure if it would make sense to change the type of the arguments from object to dict as well. Bye, Jan Scholz" Bugs closed To Be Determined python USE GITHUB Boost Development Trunk Problem fixed python exec exec_file eval default argument