python / python/cpython

zippapp/ macOS: .DS_Store files should be excluded from the generated archives

オープン
#117,829 コメント 16 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

OS-mac stdlib type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

When generating a zipapp under macOS then random ".DS_Store" files get included into the generated archive.

e.g.

$ python3.12 -m zipapp --output cfv.pyz --compress --python /usr/local/bin/python3 zipapptempdir
$ unzip -l cfv.pyz 
Archive:  cfv.pyz 
  Length      Date    Time    Name
---------  ---------- -----   ----
     6148  04-13-2024 00:17   .DS_Store
      186  04-13-2024 00:20   __main__.py
        0  04-13-2024 00:17   cfv/
     6148  04-13-2024 00:17   cfv/.DS_Store
        …
---------                     -------
   137783                     20 files

Those files quickly get regenerated by Finder, so it's hard to entirely avoid them getting added to the archive by trying to pre-delete them before executing zipapp. .DS_Store files can add significantly to the size of the archive, possible have privacy implications (e.g. leaked spotlight comments), and serve zero purpose for the python app.

CPython versions tested on:

3.12

Operating systems tested on:

macOS

Linked PRs
  • gh-120537

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

レポートに示されている python3.12 -m zipapp コマンドから始め、.DS_Store ファイルを含む一時的なアプリディレクトリを使って macOS 上で再現します。生成されたアーカイブにこれらのファイルが含まれなくなれば完了です。示されているとおり、unzip -l でアーカイブの内容を確認してください。

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

評価

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

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

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