From: Rishabh Dave Date: Wed, 16 May 2018 19:06:42 +0000 (+0000) Subject: cephfs.pyx: add py3 compatibility X-Git-Tag: v12.2.9~55^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b2892bea98a5675701c1b5fc044b1eea990a699;p=ceph.git cephfs.pyx: add py3 compatibility Signed-off-by: Rishabh Dave (cherry picked from commit 5106582fc7edae7f39161cf89e566c020fcfa0ce) --- diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 3f106c4dfc6a..fe927d2843d9 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -598,11 +598,13 @@ cdef class LibCephFS(object): if not dirent: return None + d_name = dirent.d_name if sys.version[0:2] == '2.' else dirent.d_name.\ + decode() return DirEntry(d_ino=dirent.d_ino, d_off=dirent.d_off, d_reclen=dirent.d_reclen, d_type=dirent.d_type, - d_name=dirent.d_name) + d_name=d_name) def closedir(self, DirResult dir_handler): self.require_state("mounted")