Instant always creates ~/.instant folder, even when INSTANT_CACHE_DIR and INSTANT_ERROR_DIR are set

Issue #13 resolved
Chris Richardson created an issue

In paths.py creating the temp dir uses a checksum based on calling get_instant_dir() which creates ~/.instant

This is undesirable if the user has no access to $HOME for some reason (as happened to me on a system today). The patch below should fix it.

--- a/instant/paths.py
+++ b/instant/paths.py
@@ -19,7 +19,7 @@ def get_temp_dir():
     global _tmp_dir
     if _tmp_dir is None:
         datestring = "%d-%d-%d-%02d-%02d" % time.localtime()[:5]
-        suffix = datestring + "_instant_" + compute_checksum(get_instant_dir())
+        suffix = datestring + "_instant_" + compute_checksum(get_default_cache_dir())
         _tmp_dir = tempfile.mkdtemp(suffix)
         instant_debug("Created temp directory '%s'." % _tmp_dir)
     return _tmp_dir

Comments (3)

  1. Log in to comment