X-Git-Url: https://git.tld-linux.org/?p=tld-builder.git;a=blobdiff_plain;f=TLD_Builder%2Fgpg.py;h=92e9b6a3b07a2e3987f3d0abbc83152f1ee52d6c;hp=edb8dff81e3ad76839764813253072d09e5e7b7e;hb=b7bf1e2b6deab33a0a91bbeb14f3dddf701707ba;hpb=98531ab4a0e4e065d3b11b051b3e4bd7653c6ac0 diff --git a/TLD_Builder/gpg.py b/TLD_Builder/gpg.py index edb8dff..92e9b6a 100644 --- a/TLD_Builder/gpg.py +++ b/TLD_Builder/gpg.py @@ -27,7 +27,7 @@ def get_keys(buf): cmd = ['/usr/bin/gpg', '--batch', '--no-tty', '--decrypt'] gpg_run = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) try: - d_stdout, d_stderr = gpg_run.communicate(buf.encode('utf-8')) + d_stdout, d_stderr = gpg_run.communicate(buf.decode().encode('utf-8')) except OSError as e: log.error("gnupg run, does gpg binary exist? : %s" % e) raise @@ -59,7 +59,7 @@ def verify_sig(buf): cmd = ['/usr/bin/gpg', '--batch', '--no-tty', '--decrypt'] gpg_run = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) try: - d_stdout, d_stderr = gpg_run.communicate(buf.encode('utf-8')) + d_stdout, d_stderr = gpg_run.communicate(buf.decode().encode('utf-8')) except OSError as e: log.error("gnupg run failed, does gpg binary exist? : %s" % e) raise @@ -85,7 +85,7 @@ def sign(buf): # TODO: check for gpg return code! gpg_run = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) try: - d_stdout, d_stderr = gpg_run.communicate(buf.encode('utf-8')) + d_stdout, d_stderr = gpg_run.communicate(buf.decode().encode('utf-8')) except OSError as e: log.error("gnupg signing failed, does gpg binary exist? : %s" % e) raise