From 14d23e7a0923dda84ac73dae555a3d5d5ce3421b Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 22 May 2011 10:58:36 +0000 Subject: [PATCH] * morituri/result/logger.py: Always write strftime in C locale. Fixes second bug mentioned in #49. --- ChangeLog | 6 ++++++ morituri/result/logger.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index a4405e6..b3d4244 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-05-22 Thomas Vander Stichele + + * morituri/result/logger.py: + Always write strftime in C locale. Fixes second bug + mentioned in #49. + 2011-05-21 Thomas Vander Stichele * morituri/common/checksum.py: diff --git a/morituri/result/logger.py b/morituri/result/logger.py index f0eb187..16f2eda 100644 --- a/morituri/result/logger.py +++ b/morituri/result/logger.py @@ -39,7 +39,12 @@ class MorituriLogger(object): ### global lines.append("Logfile created by: morituri %s" % configure.version) + # FIXME: when we localize this, see #49 to handle unicode properly. + import locale + old = locale.getlocale(locale.LC_TIME) + locale.setlocale(locale.LC_TIME, 'C') date = time.strftime("%b %d %H:%M:%S", time.localtime(epoch)) + locale.setlocale(locale.LC_TIME, old) lines.append("Logfile created on: %s" % date) lines.append("")