From 4be6fb75e387039c51224863b67729535ba6888a Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Tue, 10 Mar 2015 01:26:16 +0000 Subject: [PATCH] Fix potential UnicodeEncodeError in gen_key_input(). --- gnupg/gnupg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnupg/gnupg.py b/gnupg/gnupg.py index 12b46ce..ae15293 100644 --- a/gnupg/gnupg.py +++ b/gnupg/gnupg.py @@ -801,7 +801,7 @@ class GPG(GPGBase): key = key.replace('_','-').title() ## to set 'cert', 'Key-Usage' must be blank string if not key in ('Key-Usage', 'Subkey-Usage'): - if str(val).strip(): + if type(u'')(val).strip(): parms[key] = val ## if Key-Type is 'default', make Subkey-Type also be 'default'