Commit 1adefd5d authored by Julien Muchembled's avatar Julien Muchembled

same_country: fix UnicodeEncodeError in Peer.encode

parent ecda9f06
...@@ -230,7 +230,7 @@ class BaseTunnelManager(object): ...@@ -230,7 +230,7 @@ class BaseTunnelManager(object):
country = database.Reader(db).country country = database.Reader(db).country
def geoiplookup(ip): def geoiplookup(ip):
try: try:
return country(ip).country.iso_code return country(ip).country.iso_code.encode()
except errors.AddressNotFoundError: except errors.AddressNotFoundError:
return return
self._geoiplookup = geoiplookup self._geoiplookup = geoiplookup
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment