By reverting commit
5106582 'd_name' is always a bytes array. This produces
type error wherever 'd_name' is used with 'str' type. In such cases decode it.
Fixes: https://tracker.ceph.com/issues/39060
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit
d0db22a6a51d34433fa4a2d3a423373a5684f75d)
items = sorted(list_items(dir_name),
key=lambda item: item.d_name)
if not args.all and len(items) >= 2:
- items = [i for i in items if not i.d_name.startswith('.')]
+ items = [i for i in items if not i.d_name.decode('utf-8').startswith('.')]
flag = 0
if args.S:
items = sorted(items, key=lambda item: cephfs.stat(
for item in items:
path = item
if not isinstance(item, str):
- path = item.d_name
+ path = item.d_name.decode('utf-8')
if item.is_dir():
is_dir = True
else: