summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-11 04:36:01 +0900
committerkali <kali@leap.se>2012-10-11 04:39:46 +0900
commit661215788752bb7b06e8ba16ac53051a67a451b3 (patch)
treeaf7cbad159ae4a486173079072ebbb9d9c7f9ce3 /src/leap
parentdd446094737ec8274f8c5c3d59ab1466e2ebacc0 (diff)
another attempt at fixing recursion error with expanduser
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/base/config.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/leap/base/config.py b/src/leap/base/config.py
index 57f9f1b7..776c0a49 100644
--- a/src/leap/base/config.py
+++ b/src/leap/base/config.py
@@ -220,10 +220,26 @@ def get_config_dir():
# check for $XDG_CONFIG_HOME var?
# get a more sensible path for win/mac
# kclair: opinion? ^^
- return os.path.expanduser(
- os.path.join('~',
- '.config',
- 'leap'))
+
+ # XXX DEBUG for #744
+ #logger.debug('expanduser? --- %s', os.path.expanduser('~'))
+ logger.debug('$HOME? --- %s', os.environ.get('HOME', None))
+ logger.debug('user? --- %s', os.getlogin())
+
+ try:
+ return os.path.expanduser(
+ os.path.join('~',
+ '.config',
+ 'leap'))
+ except RuntimeError:
+ # We're getting a recursion error
+ # that I suspect is caused by some bug on
+ # expanduser...
+ return os.path.join(
+ 'home',
+ '%s' % os.getlogin(),
+ '.config',
+ 'leap')
def get_config_file(filename, folder=None):