From 9fdac03cefffd7143bf443374a7f4f5f30d2ba9d Mon Sep 17 00:00:00 2001 From: Mitchel Tighe <56122439+MitchelTighe@users.noreply.github.com> Date: Thu, 15 Oct 2026 20:05:10 -0400 Subject: [PATCH] ltfs_ordered_copy: copy into a destination directory again (#661) Since #649, CopyItem copies with open(self.dst, 'wb') so it can drive the progress bar. shutil.copy(), which it replaced, accepted a directory as the destination and kept the source file name; open() fails with "Is a directory", so copying several files (or a -t list) into a directory copied nothing. When the destination is an existing directory, append the source file name, which restores the previous behaviour. Fixes #661 --- src/utils/ltfs_ordered_copy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/ltfs_ordered_copy b/src/utils/ltfs_ordered_copy index 80560512..d513a0bf 100755 --- a/src/utils/ltfs_ordered_copy +++ b/src/utils/ltfs_ordered_copy @@ -54,6 +54,10 @@ class CopyItem: """""" def __init__(self, src, dst, vea_pre, cp_attr, cp_xattr, logger): #initialization self.src = src + if os.path.isdir(dst): + # Copying into a directory: keep the source file name, as + # shutil.copy() did before the progress-bar copy was introduced. + dst = os.path.join(dst, os.path.basename(src)) self.dst = dst self.vea_pre = vea_pre self.cp_attr = cp_attr