Talking to GPG on Linux through os.popen

Jim Richardson warlock at eskimo.com
Thu Aug 17 14:44:50 EDT 2000


On Thu, 17 Aug 2000 13:39:21 +0200, 
 Morten W. Petersen, in the persona of <morten at src.no>,
 brought forth the following words...:

>This snippet of code:
>
>import os
>
>f = os.popen('gpg --sign gpgtest.py','w')
>f.write("Test\n")
>
>Doesn't work for me, and I'm a bit baffled (and annoyed) because I can't
>find the problem.
>
>Thanks in advance.
>
>-Morten
>


When you say doesn't work, do you mean that gpg doesn't sign the file, or
that Test isn't written out to gpg as the passphrase?
 When I do it, gpg  asks for (and receives) my passphrase, and signs 
the file, but the f.write() seems to be a no-op because (I am a newbie here
so please be gentle if this is way off base) f is closed after gpg finishes
during the os.popen() call.

-- 
Jim Richardson
	Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
	Linux, because life's too short for a buggy OS.




More information about the Python-list mailing list