From b935eb5e466c2a2dc0433bbb1497201f87cdd5f3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Jun 2010 10:02:33 -0600 Subject: [PATCH] Fix news downloading breaking on windows systems with local encoding other than UTF-8. Fixes #5699 (Problem with Clarin recipe) --- src/calibre/web/feeds/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py index bcb8c2d74f..70b5557ad4 100644 --- a/src/calibre/web/feeds/__init__.py +++ b/src/calibre/web/feeds/__init__.py @@ -11,7 +11,7 @@ from lxml import html from calibre.web.feeds.feedparser import parse from calibre.utils.logging import default_log -from calibre import entity_to_unicode +from calibre import entity_to_unicode, strftime from calibre.utils.date import dt_factory, utcnow, local_tz class Article(object): @@ -55,7 +55,8 @@ class Article(object): def formatted_date(self): def fget(self): if self._formatted_date is None: - self._formatted_date = self.localtime.strftime(" [%a, %d %b %H:%M]") + self._formatted_date = strftime(" [%a, %d %b %H:%M]", + t=self.localtime.timetuple()) return self._formatted_date def fset(self, val): self._formatted_date = val