From 1adefd5d1cdb073bd12b8dc25bd67199ea7ec83f Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Sat, 27 Mar 2021 18:32:02 +0100
Subject: [PATCH] same_country: fix UnicodeEncodeError in Peer.encode

---
 re6st/tunnel.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/re6st/tunnel.py b/re6st/tunnel.py
index 89bf086..2659b31 100644
--- a/re6st/tunnel.py
+++ b/re6st/tunnel.py
@@ -230,7 +230,7 @@ class BaseTunnelManager(object):
             country = database.Reader(db).country
             def geoiplookup(ip):
                 try:
-                    return country(ip).country.iso_code
+                    return country(ip).country.iso_code.encode()
                 except errors.AddressNotFoundError:
                     return
             self._geoiplookup = geoiplookup
-- 
2.30.9