Automate decryption using GnuPGInterface

George rb_acm at yahoo.com
Wed Nov 30 13:30:33 EST 2005


I have 5 python scripts I've added to cron over the past year that run
correctly all the time. I double-checked the permissions and paths and
everything looks good there. Here's the cron entry that I just tested
with:
23   12   *   *   *   /usr/local/bin/decrypt_test.py >
/usr/local/bin/decrypt.log 2>&1

As for "blowing up", I get the typical stack trace, but I'm not
python-savvy enough to quite figure it out:

Traceback (most recent call last):
  File "/SHCD/scripts/decrypt_certegy.py", line 18, in ?
    attach_fhs={'stdin':inputfile,'stdout':outputfile})
  File "/usr/local/lib/python2.2/site-packages/GnuPGInterface.py", line
357, in run
    create_fhs, attach_fhs)
  File "/usr/local/lib/python2.2/site-packages/GnuPGInterface.py", line
401, in _attach_fork_exec
    if process.pid == 0: self._as_child(process, gnupg_commands, args)
  File "/usr/local/lib/python2.2/site-packages/GnuPGInterface.py", line
442, in _as_child
    os.execvp( command[0], command )
  File "/usr/local/lib/python2.2/os.py", line 298, in execvp
    _execvpe(file, args)
  File "/usr/local/lib/python2.2/os.py", line 352, in _execvpe
    raise exc, arg
OSError: [Errno 2] No such file or directory
/home/ns1/PTAccountTransfer.051130022347.pgp
Traceback (most recent call last):
  File "/SHCD/scripts/decrypt_certegy.py", line 20, in ?
    process.wait()	# cleanup
  File "/usr/local/lib/python2.2/site-packages/GnuPGInterface.py", line
639, in wait
    raise IOError, "GnuPG exited non-zero, with code %d" % (e << 8)
IOError: GnuPG exited non-zero, with code 65536


I'm guessing it has something to do with stdin, stdout, and cron, but I
can't figure out any more than that, or how I would go about changing
it.




More information about the Python-list mailing list