python / python/cpython

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

未關閉
#117,829 16 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

OS-mac stdlib type-feature
主要語言
Python
星號
77.2k
分支
36k
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. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從報告中顯示的 python3.12 -m zipapp 命令開始,並使用包含 .DS_Store 檔案的暫存應用程式目錄在 macOS 上重現該問題。產生的封存檔不再包含這些檔案即表示完成;按照所示方式使用 unzip -l 檢查封存檔內容。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。