Rev4203, Change console encoding to utf8 on Windows

This commit is contained in:
shortcutme 2019-09-03 12:00:25 +02:00
parent 166a65e1b1
commit 0b04176f18
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
3 changed files with 14 additions and 5 deletions

View file

@ -137,14 +137,14 @@ class CryptConnectionManager:
cmd, shell=True, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, env=self.openssl_env
)
back = proc.stdout.read().strip().replace(b"\r", b"")
back = proc.stdout.read().strip().decode(errors="replace").replace("\r", "")
proc.wait()
if not (os.path.isfile(self.cacert_pem) and os.path.isfile(self.cakey_pem)):
self.log.error("RSA ECC SSL CAcert generation failed, CAcert or CAkey files not exist. (%s)" % back)
return False
else:
self.log.debug("Result: %s" % back.decode())
self.log.debug("Result: %s" % back)
# Generate certificate key and signing request
cmd_params = helper.shellquote(
@ -160,7 +160,7 @@ class CryptConnectionManager:
cmd, shell=True, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, env=self.openssl_env
)
back = proc.stdout.read().strip().decode().replace("\r", "")
back = proc.stdout.read().strip().decode(errors="replace").replace("\r", "")
proc.wait()
self.log.debug("Running: %s\n%s" % (cmd, back))
@ -179,7 +179,7 @@ class CryptConnectionManager:
cmd, shell=True, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, env=self.openssl_env
)
back = proc.stdout.read().strip().decode().replace("\r", "")
back = proc.stdout.read().strip().decode(errors="replace").replace("\r", "")
proc.wait()
self.log.debug("Running: %s\n%s" % (cmd, back))