Context().import_() raise gpgme.GpgmeError in Python3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyGPGME |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
when I try to import a public gpg key in Python3 via Context() method import_ it raises an error:
gpgme.GpgmeError: (7, 32816, 'Invalid argument')
In Python2 it works fine.
Reproducer:
--------------
import gpgme
context = gpgme.Context()
context.
Expected result:
-------------------
No exception raised
Current result:
-----------------
Traceback (most recent call last):
File "test.py", line 4, in <module>
context.
gpgme.GpgmeError: (7, 32816, 'Invalid argument')
Note:
I got the same results when I use the StringIO in Python3:
import gpgme
import io
context = gpgme.Context()
stringio = io.StringIO(
context.
Am I doing something wrong?
Use of open("id_rsa.pub", 'rb') fix the issue.
But it seems to be little confusing, since my id_rsa.pub is in plaintext and not in binary format.
Moreover this issue is only Python3 specific and Python2 works well even without 'rb' mode specified.