From bbbc590d61229fb876efcc4e2dea981b4b24d4f5 Mon Sep 17 00:00:00 2001 From: "Dr. Drang" Date: Sun, 23 Sep 2012 18:37:57 -0500 Subject: [PATCH] Decode possible UTF-8 in formatted date. strftime will return an encoded string for some locales. Need to decode it before combining it with the other strings. --- archive-tweets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archive-tweets.py b/archive-tweets.py index c2ddb38..9e93d54 100644 --- a/archive-tweets.py +++ b/archive-tweets.py @@ -41,7 +41,7 @@ def setup_api(): ts = utc.localize(t.created_at).astimezone(homeTZ) lines = ['', t.text, - ts.strftime(datefmt), + ts.strftime(datefmt).decode('utf8'), urlprefix + t.id_str, '- - - - -', '']