[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/develop] Fix another UnicodeDecodeError in bridgedb.persistent log call.
commit 0e875a1f57581ebfb17dbdfd55cfab6f237de353
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Sun Feb 9 02:31:35 2014 +0000
Fix another UnicodeDecodeError in bridgedb.persistent log call.
* CHANGE patch for the same error in previous commit to use
twisted.python.reflect.safe_repr for better clarity.
* See https://travis-ci.org/isislovecruft/bridgedb/builds/18503773#L1483
---
lib/bridgedb/persistent.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/bridgedb/persistent.py b/lib/bridgedb/persistent.py
index 84260f6..3b9803d 100644
--- a/lib/bridgedb/persistent.py
+++ b/lib/bridgedb/persistent.py
@@ -20,6 +20,7 @@ try:
except (ImportError, NameError):
import pickle
+from twisted.python.reflect import safe_repr
from twisted.spread import jelly
from bridgedb import Filters, Bridges, Dist
@@ -253,15 +254,15 @@ class State(jelly.Jellyable):
setattr(self, key, value)
updated.append(key)
logging.debug("Updated %s setting: %r â?? %r" %
- (key.decode('ascii', 'replace'),
+ (safe_repr(key),
self.config.__dict__[key],
- value))
+ safe_repr(value)))
except (KeyError, AttributeError):
setattr(self, key, value)
new.append(key)
logging.debug("New setting: %s = %r" %
- (key.decode('ascii', 'replace'),
- value))
+ (safe_repr(key),
+ safe_repr(value)))
logging.info("Updated setting(s): %s" % ' '.join([x for x in updated]))
logging.info("New setting(s): %s" % ' '.join([x for x in new]))
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits