From 6eefd15744106f61240fbe6a34f08ae968a6ba7f Mon Sep 17 00:00:00 2001 From: Chris Biersbach Date: Fri, 22 Mar 2013 15:03:31 +0100 Subject: [PATCH] [FIX] Forwardport of issue when starting crons from 6.1 revision 4334 bzr revid: cbi@openerp.com-20130322140331-2trqiyuck816wj4f --- openerp/service/cron.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openerp/service/cron.py b/openerp/service/cron.py index f3c81fe785f..773191d0095 100644 --- a/openerp/service/cron.py +++ b/openerp/service/cron.py @@ -30,6 +30,7 @@ cron jobs, for all databases of a single OpenERP server instance. import logging import threading import time +from datetime import datetime import openerp @@ -60,6 +61,12 @@ def start_service(): threads it spawns are not marked daemon). """ + + # Force call to strptime just before starting the cron thread + # to prevent time.strptime AttributeError within the thread. + # See: http://bugs.python.org/issue7980 + datetime.strptime('2012-01-01', '%Y-%m-%d') + for i in range(openerp.tools.config['max_cron_threads']): def target(): cron_runner(i)