You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to execute a non-existent method on a PyObject causes a segmentation fault.
I expected an AttributeError just like it's the case when calling a non-existent method on a &PyObjectRef.
externcrate pyo3;use pyo3::{ObjectProtocol,PyObject,PyObjectRef,PyResult,Python};fnmain(){let gil = Python::acquire_gil();hello(gil.python()).unwrap_or_else(|e| e.print(gil.python()));}fnhello(py:Python) -> PyResult<()>{let io = py.import("io")?;let sio:&PyObjectRef = io.getattr("StringIO")?;// This works (throws an AttributeError as expected)// Comment this line to reproduce the segfault
sio.call_method("asdf",(0,), pyo3::NoArgs)?;let sio_obj:PyObject = sio.into();// Segfault happens here:
sio_obj.call_method(py,"asdf",(0,), pyo3::NoArgs)?;Ok(())}
The text was updated successfully, but these errors were encountered:
pyo3 version: 0.2.6
Operating System: MacOS 10.12.6
Trying to execute a non-existent method on a PyObject causes a segmentation fault.
I expected an
AttributeError
just like it's the case when calling a non-existent method on a&PyObjectRef
.The text was updated successfully, but these errors were encountered: