mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-23 00:25:18 +00:00
Fix encoding error in duplicate request check
This commit is contained in:
parent
21c436ec88
commit
aacf94bb28
@ -61,12 +61,12 @@ def store_request(buf, overwrite=False):
|
|||||||
|
|
||||||
# If there is cert, check if it's the same
|
# If there is cert, check if it's the same
|
||||||
if os.path.exists(request_path):
|
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")
|
print("Request already exists, not creating new request")
|
||||||
raise FileExistsError("Request already exists")
|
raise FileExistsError("Request already exists")
|
||||||
else:
|
else:
|
||||||
with open(request_path + ".part", "wb") as fh:
|
with open(request_path + ".part", "w") as fh:
|
||||||
fh.write(buf.encode("ascii"))
|
fh.write(buf)
|
||||||
os.rename(request_path + ".part", request_path)
|
os.rename(request_path + ".part", request_path)
|
||||||
|
|
||||||
return Request(open(request_path))
|
return Request(open(request_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user