[f18-branch/master] [PATCH] Encode unicode strings returned by pytz.country_timezones() (#887236)

Vratislav Podzimek vpodzime at redhat.com
Tue Dec 18 10:27:00 UTC 2012

pytz.country_timezones() now returns unicodes strings instead of
byte strings. Concatenating byte string and unicode string causes
traceback, so we need to encode these unicode strings as utf-8
before returning them from our function.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
 pyanaconda/timezone.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pyanaconda/timezone.py b/pyanaconda/timezone.py
index f08f0c4..5337a21 100644
--- a/pyanaconda/timezone.py
+++ b/pyanaconda/timezone.py
@@ -134,6 +134,7 @@ def get_all_territory_timezones(territory):
     except KeyError:
         timezones = list()
+    timezones = [zone.encode("utf-8") for zone in timezones]
     return timezones

More information about the anaconda-patches mailing list