about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 20c8ab35..6d16cc5e 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -25,11 +25,15 @@ TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200
 MAX_RESTORABLE_TABS = 3
 MACRO_DELIMITER = '%'
 DEFAULT_PAGER = 'less'
-LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
 CACHEDIR = os.path.expanduser("~/.cache/ranger")
 USAGE = '%prog [options] [path]'
 VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)
 
+try:
+    LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
+except FileNotFoundError:
+    LOGFILE = '/dev/null'
+
 # If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored
 # and the configuration directory will be $XDG_CONFIG_HOME/ranger instead.
 CONFDIR = '~/.config/ranger'