From fdadc89c3108de9d610443dfb9a03bcb4b643c06 Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Tue, 19 Apr 2022 20:49:49 +0200 Subject: [PATCH] Use bytes in GnuPG.confirm_key too --- GnuPG/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GnuPG/__init__.py b/GnuPG/__init__.py index b6c79aa..81f3a37 100644 --- a/GnuPG/__init__.py +++ b/GnuPG/__init__.py @@ -74,6 +74,8 @@ def public_keys( keyhome ): # confirms a key has a given email address def confirm_key( content, email ): tmpkeyhome = '' + if type(content) == 'str': + content = bytes(content, sys.getdefaultencoding()) while True: tmpkeyhome = '/tmp/' + ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(12))