From: Sage Weil Date: Wed, 17 Jul 2019 19:37:08 +0000 (-0500) Subject: pybind/rados: put lens array in outer scope X-Git-Tag: v14.2.5~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=01c7498da61a2fa529834fb46919f57aadebe49c;p=ceph.git pybind/rados: put lens array in outer scope Just paranoia about the lifecycle here Signed-off-by: Sage Weil (cherry picked from commit 86ef15f49dd545a2bdccdd5b73cc918e44a8d649) --- diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 2e38cbbe1c55..d25a50dd4d00 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -3366,12 +3366,13 @@ returned %d, but should return zero on success." % (self.name, ret)) keys = cstr_list(keys, 'keys') values = cstr_list(values, 'values') + lens = [len(v) for v in values] cdef: WriteOp _write_op = write_op size_t key_num = len(keys) char **_keys = to_bytes_array(keys) char **_values = to_bytes_array(values) - size_t *_lens = to_csize_t_array([len(v) for v in values]) + size_t *_lens = to_csize_t_array(lens) try: with nogil: