From bc9f923525f22ea79e1b7508ef3c202acdc27d4f Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Mon, 3 Jun 2019 20:55:20 -0400 Subject: sign_csr.py: Update subprocess.Popen calls. Set `universal_newlines` argument to True for `subprocess.Popen` calls that require the `stdout_data` from `proc.communicate()` to be of type `str`. --- sign_csr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sign_csr.py') diff --git a/sign_csr.py b/sign_csr.py index ee162e0..5993d8a 100644 --- a/sign_csr.py +++ b/sign_csr.py @@ -35,7 +35,7 @@ def sign_csr(pubkey, csr, email=None, file_based=False): # Step 1: Get account public key sys.stderr.write("Reading pubkey file...\n") proc = subprocess.Popen(["openssl", "rsa", "-pubin", "-in", pubkey, "-noout", "-text"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) out, err = proc.communicate() if proc.returncode != 0: raise IOError("Error loading {0}".format(pubkey)) @@ -64,7 +64,7 @@ def sign_csr(pubkey, csr, email=None, file_based=False): # Step 2: Get the domain names to be certified sys.stderr.write("Reading csr file...\n") proc = subprocess.Popen(["openssl", "req", "-in", csr, "-noout", "-text"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) out, err = proc.communicate() if proc.returncode != 0: raise IOError("Error loading {0}".format(csr)) -- cgit v1.2.3