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: v15.1.0~2139^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29096%2Fhead;p=ceph.git pybind/rados: put lens array in outer scope Just paranoia about the lifecycle here Signed-off-by: Sage Weil --- diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index ed961935b3ff..3387731e279b 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -3386,12 +3386,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: