Using GnuPG 2.1.21 (libgcrypt 1.7.6) on Windows 10 Pro 64-bit 1703 (OS Build 15063.332), mostly in a Powershell window, I encountered an odd possible issue.
The order in which you add the key export command options, can affect the quality of the exported key.
This can be tested if you import the newly exported key back into the keyring. It will result in an import fail.
So when you type: gpg --import johndoe.gpg, it leads to:
gpg: [don't know]: partial length invalid for packet type 63
gpg: read_block: read error: Invalid packet
gpg: import from '.\johndoe.gpg' failed: Invalid keyring
gpg: Total number processed: 0
The following examples of export commands will result in faulty imports:
gpg --export 'john doe' > johndoe.gpg
gpg --export -a 'john doe' > JohnDoe.asc
gpg --armor --export 'john doe' > johndoe.asc
gpg -a --export 'john doe' > johndoe.asc
However, the following export command results in valid keys to import:
gpg -o johndoe.gpg --export 'john doe'
For now this will be my syntax to export keys in Windows, but I assume this is not how key export is supposed to work. At least it is undocumented.
On my Linux (Debian/Ubuntu-based) VM, gpgp does not seem to suffer from this issue.