python / python/cpython

netrc: accept open file object as initialization argument

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

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

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

説明

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]

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

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

はじめの一歩

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

調査の方向性

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

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

評価

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

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

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