]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: auto encode/decode cstr 26476/head
authorKefu Chai <kchai@redhat.com>
Thu, 21 Feb 2019 15:00:35 +0000 (23:00 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 21 Feb 2019 15:05:52 +0000 (23:05 +0800)
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 <kchai@redhat.com>
src/pybind/rados/rados.pyx
src/pybind/rbd/rbd.pyx

index 052c491517df838e010923d9094ee6859b21c615..b95500eb33544a6813c0e8430eb1ea164a6bd469 100644 (file)
@@ -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.
 
index 9688f24ae0ffaef7e7869c71b05e2cc1a05186f0..1e247e72d8fe668de12735c11e4cbe1916213bf3 100644 (file)
@@ -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.