Re: parsing encrypted netrc file

2020-06-23 Thread Barry Scott
> On 22 Jun 2020, at 23:38, Seb wrote: > > Hello, > > What's the pythonic way to do this without polluting the user's > directory with the decrypted file? I wrongly thought this should do it: > > import os.path as osp > import gnupg > import netrc > import tempfile > > gpg = gnupg.GPG() >

Re: parsing encrypted netrc file

2020-06-23 Thread Seb
On Tue, 23 Jun 2020 02:08:19 +0100, MRAB wrote: [...] > Here's a page I found about ".netrc": > https://ec.haxx.se/usingcurl/usingcurl-netrc > and here's a page I found about ".authinfo.gpg": > https://www.emacswiki.org/emacs/GnusAuthinfo > Can you see the subtle difference? Awww nuts, I do

Re: parsing encrypted netrc file

2020-06-22 Thread MRAB
On 2020-06-23 01:47, Seb wrote: On Tue, 23 Jun 2020 00:40:28 +0100, MRAB wrote: On 2020-06-22 23:38, Seb wrote: Hello, What's the pythonic way to do this without polluting the user's directory with the decrypted file? I wrongly thought this should do it: import os.path as osp import gn

Re: parsing encrypted netrc file

2020-06-22 Thread Seb
On Tue, 23 Jun 2020 00:40:28 +0100, MRAB wrote: > On 2020-06-22 23:38, Seb wrote: >> Hello, >> What's the pythonic way to do this without polluting the user's >> directory with the decrypted file? I wrongly thought this should do >> it: >> import os.path as osp import gnupg import netrc import

Re: parsing encrypted netrc file

2020-06-22 Thread MRAB
On 2020-06-22 23:38, Seb wrote: Hello, What's the pythonic way to do this without polluting the user's directory with the decrypted file? I wrongly thought this should do it: import os.path as osp import gnupg import netrc import tempfile gpg = gnupg.GPG() with open(osp.expanduser("~/.authin

parsing encrypted netrc file

2020-06-22 Thread Seb
Hello, What's the pythonic way to do this without polluting the user's directory with the decrypted file? I wrongly thought this should do it: import os.path as osp import gnupg import netrc import tempfile gpg = gnupg.GPG() with open(osp.expanduser("~/.authinfo.gpg"), "rb") as f: with tem