From c36d0f1a7de4668eb81075e4a94846cf81fc30cd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 21 Feb 2019 23:00:35 +0800 Subject: [PATCH] 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 --- src/pybind/rados/rados.pyx | 2 +- src/pybind/rbd/rbd.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 052c491517df8..b95500eb33544 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 9688f24ae0ffa..1e247e72d8fe6 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.