Skip to content
Snippets Groups Projects
Commit 7e419031 authored by Simon Lejeune's avatar Simon Lejeune
Browse files

[FIX] config.py: do not use appsdir to define the user's data dir when he has...

[FIX] config.py: do not use appsdir to define the user's data dir when he has no home directory on unix

Force it to be '/var/lib/(appname)' in this case
parent f2598ecd
No related branches found
No related tags found
No related merge requests found
......@@ -62,9 +62,15 @@ DEFAULT_LOG_HANDLER = [':INFO']
def _get_default_datadir():
home = os.path.expanduser('~')
func = appdirs.user_data_dir if os.path.exists(home) else appdirs.site_data_dir
if os.path.exists(home):
func = appdirs.user_data_dir
else:
if sys.platform in ['win32', 'darwin']:
func = appdirs.site_data_dir
else:
func = lambda **kwarg: "/var/lib/%s" % kwarg['appname']
# No "version" kwarg as session and filestore paths are shared against series
return func(appname='Odoo', appauthor=release.author)
return func(appname='openerp', appauthor=release.author)
class configmanager(object):
def __init__(self, fname=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment