I don't believe this demonstrates a bug.
I think the problem is that your key export fails, because you pointed --homedir at the (presumably)
empty directory "%tmp%\_tempKeyring". This leads to the not very helpful error message about the
eof. If the export were successful, gpg would have written the key to stdout.
For reference, here is what I tried. First GNUPGHOME points to a home with the key I want to export:
$ echo $GNUPGHOME
/tmp/tmp.T7I4M9RIc3
$ g10/gpg --list-keys alpha
gpg: please do a --check-trustdb
pub dsa1024 1999-03-08 [SCA]
A0FF4590BB6122EDEF6E3C542D727CC768697734
uid [ unknown] Alfa Test (demo key) <alfa@example.net>
uid [ unknown] Alpha Test (demo key) <alpha@example.net>
uid [ unknown] Alice (demo key)
sub elg1024 1999-03-08 [E]You need some kind of pinentry program, because you may be asked for the current passphrase or an
export passphrase:
$ cat $GNUPGHOME/gpg-agent.conf
pinentry-program /usr/bin/pinentry-x11Now export the key:
$ g10/gpg --export-secret-keys alpha >/tmp/alpha.gpg
Now I create an empty home, and import the key in batch mode:
$ export GNUPGHOME=$(mktemp -d)
$ g10/gpg --batch --import /tmp/alpha.gpg
gpg: keybox '/tmp/tmp.bL2caQmZri/pubring.kbx' created
gpg: /tmp/tmp.bL2caQmZri/trustdb.gpg: trustdb created
gpg: key 2D727CC768697734: public key "Alfa Test (demo key) <alfa@example.net>" imported
gpg: key 2D727CC768697734: secret key imported
gpg: Total number processed: 3
gpg: imported: 1
gpg: secret keys read: 3
gpg: secret keys imported: 2Could you please check if that works for you?