From: John Spray Date: Fri, 1 Apr 2016 13:27:31 +0000 (+0100) Subject: pybind: fix unicode handling in CephFSVolumeClient::purge X-Git-Tag: v10.2.2~39^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=46c2bd0864f8f7ace80a8cad07b873d9aa57ead9;p=ceph.git pybind: fix unicode handling in CephFSVolumeClient::purge os.path.join is sensitive to string encoding, but just doing a straight substitution should not be. Signed-off-by: John Spray (cherry picked from commit e590f4d05fdb46747e83e35e66a26d9f4aa0314d) --- diff --git a/src/pybind/ceph_volume_client.py b/src/pybind/ceph_volume_client.py index d5748f126a2..16d32476f50 100644 --- a/src/pybind/ceph_volume_client.py +++ b/src/pybind/ceph_volume_client.py @@ -517,7 +517,10 @@ class CephFSVolumeClient(object): d = self.fs.readdir(dir_handle) while d: if d.d_name not in [".", ".."]: - d_full = os.path.join(root_path, d.d_name) + # Do not use os.path.join because it is sensitive + # to string encoding, we just pass through dnames + # as byte arrays + d_full = "{0}/{1}".format(root_path, d.d_name) if d.is_dir(): rmtree(d_full) else: