Fix tor status logging with foreign languages

This commit is contained in:
shortcutme 2018-04-28 21:53:36 +02:00
parent 13019941b3
commit 24a7c26819
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -105,7 +105,7 @@ class TorManager(object):
# Terminate on exit # Terminate on exit
atexit.register(self.stopTor) atexit.register(self.stopTor)
except Exception, err: except Exception, err:
self.log.error("Error starting Tor client: %s" % Debug.formatException(err)) self.log.error(u"Error starting Tor client: %s" % Debug.formatException(str(err).decode("utf8", "ignore")))
self.enabled = False self.enabled = False
return False return False
@ -206,8 +206,8 @@ class TorManager(object):
self.conn = conn self.conn = conn
except Exception, err: except Exception, err:
self.conn = None self.conn = None
self.setStatus(u"Error (%s)" % err) self.setStatus(u"Error (%s)" % str(err).decode("utf8", "ignore"))
self.log.warning("Tor controller connect error: %s" % Debug.formatException(err)) self.log.warning(u"Tor controller connect error: %s" % Debug.formatException(str(err).decode("utf8", "ignore")))
self.enabled = False self.enabled = False
return self.conn return self.conn