Drop noisy 'Output path is outside the input file's directory tree' warning

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

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

resize と convert が “outside the input file's directory tree” という警告を出す箇所を見つけ、その周辺のパスチェックとテストを読んでください。提案どおり警告を削除するか、条件付きにするかを判断してください。通常の使い方で別の出力ディレクトリを指定してもコマンド出力が警告で埋め尽くされず、セキュリティ警告を残す場合は疑わしいパスに限定されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Problem

When --output is a directory outside the input file's own folder, every resize and convert call prints:

Warning: Output path '/some/other/dir' is outside the input file's directory tree

Writing to a separate folder is the safe pattern. It is exactly what protects the source from the overwrite in #25. Warning on it trains users to ignore warnings, and in a batch loop it buries the real output. In one 24-photo run the warning printed well over 100 times.

Proposal

  • Remove this warning, or keep it behind --verbose.
  • If there is a security reason for it (path traversal from untrusted input?), say so in the message, and only warn when the path actually looks suspicious.
  • Consider a --quiet flag that suppresses everything except errors, for scripted use.

Context

ipro 1.7.0, macOS. Output dir was a scratch folder; input was on an external volume.

— Emily

主要言語
Python
スター
1
フォーク
0
平均マージ
4時間 13分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

cadentdev/ipro のほかの issue

cadentdev/ipro の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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