From: Kefu Chai Date: Thu, 21 Feb 2019 15:00:35 +0000 (+0800) Subject: pybind: auto encode/decode cstr X-Git-Tag: v14.1.0~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26476%2Fhead;p=ceph.git pybind: auto encode/decode cstr assuming all string in the cythonized string use the legacy python2 string type, instead of using the unicode, and assuming all c strings are ASCII, so we don't need encode/decode them when coerce from/to C strings. this helps when generating py3 bindings Signed-off-by: Kefu Chai --- diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 052c491517df..b95500eb3354 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -1,4 +1,4 @@ -# cython: embedsignature=True +# cython: embedsignature=True, c_string_type=str, c_string_encoding=ascii """ This module is a thin wrapper around librados. diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 9688f24ae0ff..1e247e72d8fe 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -1,4 +1,4 @@ -# cython: embedsignature=True +# cython: embedsignature=True, c_string_type=str, c_string_encoding=ascii """ This module is a thin wrapper around librbd.