I am trying to create a gpp keys using the pyhton-gnupg , my code is as follows,
user="test"
email='test@testmail.com'
passwod='testpass'
gpguhome='/usr/home/test/.gnupg'
gpg=gnupg.GPG(gnupghome=gpguhome,verbose=True)
input_data=gpg.gen_key_input(name_email=email,passphrase=passwod,key_length=1024,name_real=user,name_comment='My Key',expire_date=0,key_type="RSA")
key=gpg.gen_key(input_data)
print(key)
I am getting the following error code
2020-11-10 16:05:49 +0702] - gpg returned a non-zero error code: 2
This error seems comming from GPG , How can I fix it ?