Comment 2 for bug 1212214

Revision history for this message
AndreiM (andrei-macavei89) wrote :

Hi,

It seems that Context.import_() doesn't accept unicode strings and , if I remember correctly, in Python 3 all strings are unicode and after you open the file you get a unicode string as argument for the io.StringIO().

If you want you can use this (it works in Python2):

from StringIO import StringIO

ctx = gpgme.Context()
strio = StringIO(open("id_rsa.pub").read())
ctx.import_(strio)