From a921dc7a528354831e826efa2387ab70aaa1c65e Mon Sep 17 00:00:00 2001 From: Dan Weatherill Date: Wed, 3 Jan 2018 07:09:44 +0000 Subject: [PATCH] Fix signatures failing to verify for binary files in py3k --- gnupg/_util.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnupg/_util.py b/gnupg/_util.py index 901894f..de7e670 100644 --- a/gnupg/_util.py +++ b/gnupg/_util.py @@ -199,10 +199,8 @@ def s(x): def binary(data): coder = find_encodings() - - if _py3k and isinstance(data, bytes): - encoded = coder.encode(data.decode(coder.name))[0] - elif _py3k and isinstance(data, str): + + if _py3k and isinstance(data, str): encoded = coder.encode(data)[0] elif not _py3k and type(data) is not str: encoded = coder.encode(data)[0]