New GitHub issue #98235 from steelman:<br>
<hr>
<pre>
# 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.
``` python
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]
```
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/98235">View on GitHub</a>
<p>Labels: type-feature</p>
<p>Assignee: </p>