Closed RonAvitzur closed 4 years ago
I just realized that my Xcode Build Settings Headers search paths pointed to /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Headers which is the Python 3.7 included in Xcode 11, but I was compiling with a static library of Python 3.8. Oops.
My bad. "Never mind." (in SNL's Emily Litella's voice.) PEBKAC. Problem exists between keyboard and computer.
When frame->f_code->co_filename == NULL pybind11 crashes constructing the C++ exception
Using PyBind11 on Xcode 11 on macOS, I'm seeing a runtime error in cast.h in
PYBIND11_NOINLINE inline std::string error_string
athandle(frame->f_code->co_filename).cast<std::string>()
when co_filename is NULL as the constructed handle isn't a valid python object. This is inside ofMy code looks something like:
Changing cast.h to ignore NULL co_filename avoids this,
but since I'm brand new to both Python, pybind11 and sympy and have no idea what the underlying problem is, I don't know if the bandaid on the symptom leaves a more fundamental problem lurking. The problem is solely in constructing the error string for the C++ exception, so it seems a low priority.