isislovecruft / python-gnupg

A modified version of python-gnupg, including security patches, extensive documentation, and extra features.
Other
426 stars 171 forks source link

TypeError: _encrypt() got multiple values for argument 'recipients' #277

Open devorbit opened 3 years ago

devorbit commented 3 years ago

Hi All! I am getting one error where I am trying to do encrypt a file with the following command but its showing error even though I am passing argument recipient one time. Please help me on the same. rkey: str = 'test_key_id'

with open('my-unencrypted.txt', 'rb') as f: status = gpg.encrypt( data=f, recipients=rkey, always_trust=True, output='encrypted.txt.gpg')

For rkey I also tried rkey = str(imported_keys.fingerprints[0])

but nothing is working and I am getting error like status = gpg.encrypt( File "\venv\lib\site-packages\gnupg\gnupg.py", line 1064, in encrypt result = self._encrypt(stream, recipients, kwargs) TypeError: _encrypt() got multiple values for argument 'recipients'**

kiorq commented 3 years ago

I believe recipients is supposed to be a list or tuple.