During actium tests I encountered a problem with the gpgme export function (ctx.Export() in the go bindings) with export mode extern.
Given a broken ldap address in dirmngr.conf (e.g. keyserver ldap:doesnotexist::::), the function will happily return without any errors.
On console a gpg --send-keys will complain about it:
$ gpg --send-keys A7AC9BFA730300F81EC8C66C24E1242A9EE88FC7 gpg: sending key 24E1242A9EE88FC7 to ldap:doesnotexist gpg: keyserver send failed: Cannot contact LDAP server gpg: keyserver send failed: Cannot contact LDAP server
To reproduce with python bindings (same behaviour, no error):
import gpg
fpr = "A7AC9BFA730300F81EC8C66C24E1242A9EE88FC7"
with gpg.Context() as ctx:
ctx.op_export(fpr, gpg.constants.EXPORT_MODE_EXTERN, None)