os.path.join is sensitive to string encoding, but
just doing a straight substitution should not be.
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit
e590f4d05fdb46747e83e35e66a26d9f4aa0314d)
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: