summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-06-03 20:55:20 -0400
committerrsiddharth <s@ricketyspace.net>2019-06-03 20:55:20 -0400
commitbc9f923525f22ea79e1b7508ef3c202acdc27d4f (patch)
tree25a17eaa06bc57ffb7b672ec30ce4db608c4bae0
parent72a96df3da4fac91ca13dc702472dd98cc83c060 (diff)
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`.
-rw-r--r--sign_csr.py4
1 files changed, 2 insertions, 2 deletions
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))