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
1 changed files with 3 additions and 3 deletions

View File

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