When I run "gpg --batch -d file.gpg < /dev/null", I'm still asked for a passphrase, while the gpg(1) man page says for this option: Use batch mode. Never ask, do not allow interactive commands.
I've eventually found that "--pinentry-mode error" (or "--pinentry-mode cancel") allows me to avoid this issue. I suppose that --batch should set the pinentry mode to "error" so that it behaves as documented.