Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#661 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

@MitchelTighe がすでに取り組んでいます。

2026年10月16日 から。

  • #662 @MitchelTighe による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LinearTapeFileSystem/ltfs のほかの issue

LinearTapeFileSystem/ltfs の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。