diff --git a/odoo/tools/config.py b/odoo/tools/config.py index ec7cc0c0cb1..5e925aba0e2 100644 --- a/odoo/tools/config.py +++ b/odoo/tools/config.py @@ -6,6 +6,7 @@ try: except ImportError: import ConfigParser +import errno import logging import optparse import os @@ -620,9 +621,11 @@ class configmanager(object): @property def session_dir(self): d = os.path.join(self['data_dir'], 'sessions') - if not os.path.exists(d): + try: os.makedirs(d, 0o700) - else: + except OSError as e: + if e.errno != errno.EEXIST: + raise assert os.access(d, os.W_OK), \ "%s: directory is not writable" % d return d