From 876e0667e6ecefa81c95a5e077ef58c1ff0c2e91 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Wed, 28 Jan 2009 16:51:16 +0200 Subject: [PATCH] Logger: format the date numerically, avoid locale When loading a translation file (and only then), the locale is set, which affects the date formatting. Then, the logger messages fail to be displayed on the console, because of illegal chars. bzr revid: p_christ@hol.gr-20090128145116-mu2jm5i264afj2vz --- bin/netsvc.py | 2 +- bin/tools/translate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index f44d0e0f8a0..1f1904ac179 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -92,7 +92,7 @@ def init_logger(): logger = logging.getLogger() # create a format for log messages and dates - formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S') + formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%Y-%m-%d %H:%M:%S') if tools.config['syslog']: # SysLog Handler diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 4345a865ffa..8238180df49 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -606,7 +606,7 @@ def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name= }) # Here we try to reset the locale regardless. try: - locale.setlocale(locale.LC_ALL, str(lc + '.' + encoding)) + locale.resetlocale(locale.LC_ALL) except: pass lang_ids = lang_obj.search(cr, uid, [])