netrc: accept open file object as initialization argument

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

netrc.netrc の初期化エントリーポイントから始め、現在の引数処理を提供された io.StringIO の例と比較します。既存の入力を変更せずに、開かれた io.TextIOBase オブジェクトをどのように読み取るべきかを確認し、その後、パースと authenticator の検索が引き続き期待どおりの結果を生成することを検証します。

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

説明

stdlib type-feature

Feature or enhancement

Make netrc class accept open file object (io.TextIOBase subclass) as an initialization argument.

Pitch

Providing netrc data via StringIO makes it possible to retrieve it from a verity of different sources e.g. an encrypted file. With few additional lines lines of code .netrc becomes a secure password store.

import gpg

with open(file) as file_gpg:
    with gpg.Context() as c:
        plaintext = c.decrypt(file_gpg)[0]
        nrc_data = io.StringIO(plaintext.decode('utf-8'))
        nrc = netrc.netrc(nrc_data)
passwd = nrc.authenticators(hostname)[2]
主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

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

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

はじめの一歩

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

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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