Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ltfs_ordered_copy: copying several files into a directory fails with 'Is a directory' since v2.4.9.0

Đang mở Phù hợp với người mới
#661 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

@MitchelTighe đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #662 của @MitchelTighe — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu từ script ltfs_ordered_copy trong src/utils, tại CopyItem.run() và hàm trợ giúp _run_copy() mà nó gọi, hàm này mở đích bằng open(self.dst, 'wb'). Tái hiện lỗi bằng các lệnh mkdir và ltfs_ordered_copy trong issue, dùng hai tệp thông thường và một thư mục đã tồn tại làm đích. Hoàn thành khi cả hai tệp được sao chép vào thư mục với đúng tên của chúng, trường hợp --keep-tree và trường hợp chỉ có một nguồn vẫn hoạt động như trước, và đường xử lý một nguồn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

Since v2.4.9.0, ltfs_ordered_copy fails every file when several files (or a -t list from stdin) are copied into a destination directory. This is the second and fourth example in the man page:

$ ltfs_ordered_copy /foo/aaa /foo/bbb /bar
$ find /foo/ddd -type f | ltfs_ordered_copy -t /bar

Output:

Failed to copy "src/a.txt" to "dst": [Errno 21] Is a directory: 'dst'
Failed to copy "src/b.txt" to "dst": [Errno 21] Is a directory: 'dst'
Copied 0 files, Failed 2 files.

To Reproduce

mkdir src dst && echo aaa > src/a.txt && echo bbb > src/b.txt
ltfs_ordered_copy src/a.txt src/b.txt dst

The same command with src/utils/ltfs_ordered_copy taken from earlier commits:

Commit Result
efc9e3a (Release/v2.4.9.0, #649) Copied 0 files, Failed 2 files
efc9e3a~1 (2026-07-29) Copied 2 files
fd41c66 (2023-11-27) Copied 2 files
303ca43 (2020-12-09) Copied 2 files

Cause

#649 replaced shutil.copy2() / shutil.copy() in CopyItem.run() with _run_copy(), which does open(self.dst, 'wb') so it can drive the progress bar. shutil.copy accepted a directory as the destination and appended the source file name. open() does not, so any plain-file source whose destination is a directory fails. With --keep-tree the destination is a full file path, so that case still works. The single-source case is handled separately with shutil.copy, so it is also unaffected.

Expected behavior

Files are copied into the directory under their own names, as before v2.4.9.0.

Environment

Python 3, current main (efc9e3a). Reproduced off-tape with a stub xattr module, so the non-LTFS destination path is exercised. The failure is in the copy step itself, which LTFS and non-LTFS destinations share.

Ngôn ngữ chính
C
Star
358
Fork
111
Merge trung bình
5 ngày 1 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LinearTapeFileSystem/ltfs

Tất cả issue của LinearTapeFileSystem/ltfs

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.