From aacf94bb284a8b776f8daf7a27a3ecb1c1f82298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 14 Jan 2016 10:44:26 +0200 Subject: [PATCH] Fix encoding error in duplicate request check --- certidude/authority.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/certidude/authority.py b/certidude/authority.py index 3c4ffd8..71c6562 100644 --- a/certidude/authority.py +++ b/certidude/authority.py @@ -61,12 +61,12 @@ def store_request(buf, overwrite=False): # If there is cert, check if it's the same if os.path.exists(request_path): - if open(request_path, "rb").read() != buf: + if open(request_path).read() != buf: print("Request already exists, not creating new request") raise FileExistsError("Request already exists") else: - with open(request_path + ".part", "wb") as fh: - fh.write(buf.encode("ascii")) + with open(request_path + ".part", "w") as fh: + fh.write(buf) os.rename(request_path + ".part", request_path) return Request(open(request_path))