This bug is similar but not identical to T1427.
In running
gpg --symmetric --armor --no-tty --quiet --batch --passphrase passphrase
I get the error message
can't connect to `~/.gnupg/S.gpg-agent': No such file or directory
Encryption succeeds and the exit code is 0. My question is, why is the error
message there at all (e.g. why is gpg trying to connect to the gpg-agent at
all)? The key is provided on the command line, and in fact
/usr/bin/gpg --decrypt --no-tty --quiet --batch --passphrase passphrase
does not result in this message.