about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py4
-rw-r--r--ranger/core/main.py3
2 files changed, 2 insertions, 5 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 18302431..cd6c6afe 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1118,10 +1118,6 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             data['loading'] = False
             return path
 
-        if ranger.args.clean:
-            # Don't access args.cachedir in clean mode
-            return None
-
         if not os.path.exists(ranger.args.cachedir):
             os.makedirs(ranger.args.cachedir)
         cacheimg = os.path.join(ranger.args.cachedir, self.sha1_encode(path))
diff --git a/ranger/core/main.py b/ranger/core/main.py
index aefaacbc..7322a501 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -333,7 +333,8 @@ def parse_arguments():
         return path
 
     if args.clean:
-        args.cachedir = None
+        from tempfile import mkdtemp
+        args.cachedir = mkdtemp(suffix='.ranger-cache')
         args.confdir = None
         args.datadir = None
     else: