ltfs_ordered_copy: copying several files into a directory fails with 'Is a directory' since v2.4.9.0
メンテナーはふだん 6 日以内に返信
評価
調査の方向性
src/utils 配下の ltfs_ordered_copy スクリプトにある CopyItem.run() と、そこから呼び出される _run_copy() ヘルパーから始めてください。_run_copy() は open(self.dst, 'wb') で宛先を開きます。issue にある mkdir と ltfs_ordered_copy のコマンドを使い、通常のファイル 2 つと既存のディレクトリを宛先にして再現してください。両方のファイルがそれぞれの名前でディレクトリにコピーされ、--keep-tree の場合と単一ソースの場合が従来どおり動作し、単一ソースの経路が変更されていなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 358
- フォーク
- 111
- 平均マージ
- 5日 1時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LinearTapeFileSystem/ltfs のほかの issue
-
2.4.9.1 mkltfs failed対応中かも @madjesc が 3 日前に担当しました。 オープンInvestigating
LinearTapeFileSystem/ltfs#656 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 6 日以内に返信
-
ltfs/mkltfs segfault when the drive INQUIRY vendor id is not IBM/HP/HPE/QUANTUM (NULL deref in _raw_open)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
LinearTapeFileSystem/ltfs#650 ·
メンテナーはふだん 6 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
LinearTapeFileSystem/ltfs#647 · コメント 1 件 ·
メンテナーはふだん 6 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
LinearTapeFileSystem/ltfs#643 ·
メンテナーはふだん 6 日以内に返信
-
Format fails on HP LTO-6 6250 with Adaptec HBA再び着手できるかも @madjesc が 47 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンH/W issue HBA Report Investigating
LinearTapeFileSystem/ltfs#640 · コメント 10 件 · 担当者 1 名 ·
メンテナーはふだん 6 日以内に返信
LinearTapeFileSystem/ltfs の issue をすべて見る
似ている issue
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
antoxa2584x/nfsu2-sw#44 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
codepointerapp/codepointer#231 ·