From 15e0d1c385e5d4817963749f206f63518afcc378 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Mon, 13 May 2019 17:30:01 +0530 Subject: [PATCH] cephfs-shell: Fix flake8 invalid escape sequence warning Backslash-character pair is not a valid escape sequence, since Python 3.6 version. Prefixing character 'r' to the escape sequence, fixes the warning. Fixes: https://tracker.ceph.com/issues/39717 Signed-off-by: Varsha Rao (cherry picked from commit c7d217c2afcb9cdc64356f6a6b1f8f701c7814d9) --- src/tools/cephfs/cephfs-shell | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 4e5d4e3a8899e..8e8c2384afc83 100644 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -570,7 +570,7 @@ exists.') else: for src_dir, dirs, files in os.walk(root_src_dir): dst_dir = src_dir.replace(root_src_dir, root_dst_dir, 1) - dst_dir = re.sub('\/+', '/', cephfs.getcwd().decode('utf-8') + dst_dir) + dst_dir = re.sub(r'\/+', '/', cephfs.getcwd().decode('utf-8') + dst_dir) if args.force and dst_dir != '/' and not is_dir_exists(dst_dir[:-1]) and len(locate_file(dst_dir)) == 0: try: cephfs.mkdirs(to_bytes(dst_dir), 0o777) @@ -591,7 +591,7 @@ exists.') for file_ in files: src_file = os.path.join(src_dir, file_) - dst_file = re.sub('\/+', '/', '/' + dst_dir + '/' + file_) + dst_file = re.sub(r'\/+', '/', '/' + dst_dir + '/' + file_) if (not args.force) and is_file_exists(dst_file): return copy_from_local(src_file, os.path.join( -- 2.39.5