diff --git a/apis/python/src/tiledbsoma/soma_vfs.cc b/apis/python/src/tiledbsoma/soma_vfs.cc index c565684e92..cc0211df72 100644 --- a/apis/python/src/tiledbsoma/soma_vfs.cc +++ b/apis/python/src/tiledbsoma/soma_vfs.cc @@ -80,8 +80,11 @@ class SOMAVFSFilebuf : public tiledb::impl::VFSFilebuf { return py::bytes(""); } + py::gil_scoped_release release; std::string buffer(nbytes, '\0'); offset_ += xsgetn(&buffer[0], nbytes); + py::gil_scoped_acquire acquire; + return py::bytes(buffer); } @@ -104,10 +107,16 @@ void load_soma_vfs(py::module& m) { "open", [](SOMAVFSFilebuf& buf, const std::string& uri) { return buf.open(uri, std::ios::in); - }) + }, + py::call_guard()) .def("read", &SOMAVFSFilebuf::read, "size"_a = -1) .def("tell", &SOMAVFSFilebuf::tell) - .def("seek", &SOMAVFSFilebuf::seek, "offset"_a, "whence"_a = 0) + .def( + "seek", + &SOMAVFSFilebuf::seek, + "offset"_a, + "whence"_a = 0, + py::call_guard()) .def("close", &SOMAVFSFilebuf::close, "should_throw"_a = true); } } // namespace libtiledbsomacpp \ No newline at end of file