Support copy.replace() for zipfile.ZipInfo
オープン
まだ誰も着手していません。
stdlib
type-feature
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
There is no easy way to get a copy of a zipfile.ZipInfo object with some attributes changed, for example to write a member read from one archive to another under a different name.
I propose to support copy.replace():
zinfo = copy.replace(zf.getinfo('spam.txt'), filename='eggs.txt')
Attributes which are not replaced are inherited from the original object. As in the constructor, the file name is sanitized and the date is validated.
Linked PRs
- gh-155045
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
zipfile.ZipInfoのエントリポイントとcopy.replace()プロトコルから始めます。issueではソースファイルもテストも指定されていません。継承された属性、ファイル名のサニタイズ、日付の検証を含め、ZipInfoコンストラクターと置換動作を比較します。ZipInfoメンバーを選択した属性を変更した状態でコピーし、別のファイル名で使用できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100