On 2025-06-30 Jeffrey Rhodes <chaletrho...@me.com> wrote:
> The pinentry bug is coincident with updating to or after a new install
> to 12.11. Prior to that a python3 script running in a Terminal could
> call os.system(‘gpg —decrypt file’) and a PIN pop-up window would
> request a Passphrase. Also, no decryption errors are reported, not
> even when the key needed for decryption is locally missing. 


Works for me with both  pinentry-gtk2 and  pinentry-tty.

ametzler@argenau:~$ rm -rf /tmp/gpghome ; install -d -m0700 /tmp/gpghome ; gpg  
--homedir /tmp/gpghome --batch --pinentry-mode loopback --passphrase 1234 
--quick-generate-key b...@example.com
gpg: keybox '/tmp/gpghome/pubring.kbx' created
gpg: /tmp/gpghome/trustdb.gpg: trustdb created
gpg: directory '/tmp/gpghome/openpgp-revocs.d' created
gpg: revocation certificate stored as 
'/tmp/gpghome/openpgp-revocs.d/9C7D203179D87C924581E1968507ED6E2CB369C7.rev'
ametzler@argenau:~$ echo content > /tmp/input
ametzler@argenau:~$ gpg --homedir /tmp/gpghome --encrypt --recipient 
b...@example.com /tmp/input
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2028-07-06
ametzler@argenau:~$ /tmp/run-py.py
gpg: encrypted with cv25519 key, ID 02D8ABA3508D585F, created 2025-07-07
      "b...@example.com"
Please enter the passphrase to unlock the OpenPGP secret key:
"b...@example.com"
255-bit ECDH key, ID 02D8ABA3508D585F,
created 2025-07-07 (main key ID 8507ED6E2CB369C7).

Passphrase:
content
ametzler@argenau:~$ cat /tmp/run-py.py
#!/usr/bin/python3

import os

# ametzler@argenau:~$ rm -rf /tmp/gpghome ; install -d -m0700 /tmp/gpghome ; 
gpg --homedir /tmp/gpghome --batch --pinentry-mode loopback --passphrase 1234 
--quick-generate-key b...@example.com
#  echo content > /tmp/input
# gpg --homedir /tmp/gpghome --encrypt --recipient b...@example.com /tmp/input

os.system("gpg --homedir /tmp/gpghome --decrypt  /tmp/input.gpg")

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

Reply via email to