diff src/bnpparibas.py @ 5:a47012c9db15

Fix
author Daniele Nicolodi <daniele@grinta.net>
date Wed, 25 Mar 2015 01:42:21 +0100
parents b4c2db70bbf2
children
line wrap: on
line diff
--- a/src/bnpparibas.py	Wed Mar 25 01:38:07 2015 +0100
+++ b/src/bnpparibas.py	Wed Mar 25 01:42:21 2015 +0100
@@ -404,10 +404,10 @@
         cmd = [ "gpg", "--homedir", self.homedir, "--batch", "--yes", "--no-options", "--armor",
                 "--local-user", sender, "--recipient", recipient, "--sign", "--encrypt"]
         p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        encdata, err = p.communicate(input=message.encode('utf-8'))[0].decode('ascii')
+        encdata, err = p.communicate(input=message.encode('utf-8'))
         if p.returncode:
             raise RuntimeError(p.returncode, err)
-        return encdata
+        return encdata.decode('ascii')
 
 
 @click.command()