"error_already_set at memory location" exception throws when python call pybind function with std::variant<> argument
aungkhant0911 opened this issue · comments
Aung Khant commented
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
latest release build
Problem description
The exception occurs in call() function's reinterpret_steal. As the title mentioned, the problem persist, as long as the argument of doS is variant. I am not sure what I am missing.
Reproducible example code
pybind code:
void doS(variant<bool, int> var) {
cout << "value of 'b' is " << get<0>(var) << endl;
}
int main() {
py::scoped_interpreter guard{};
py::module_ te = py::module_::import("testing");
te.def("blah", &doS);
te.attr("h")();
return 0;
}
testing.py :
def h():
print("H H HH H ")
blah(345)
Is this a regression? Put the last known working version here if it is.
Not a regression
Aung Khant commented
resolved