[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Make intermediate data directories



commit 8ee3971432099ab0c986b6a8cc3fa1212cbe85e2
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri Nov 10 11:50:50 2017 -0800

    Make intermediate data directories
    
    Oops, when creating our data directory we didn't recurse. In practice this is
    generally fine since we're making a directory in the user's home, but if the
    user customized it they'd likely nail this.
---
 nyx/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nyx/__init__.py b/nyx/__init__.py
index ce1f8c5..256764f 100644
--- a/nyx/__init__.py
+++ b/nyx/__init__.py
@@ -75,7 +75,7 @@ SQLITE_UNAVAILABLE_FREEBSD = """\
 Python's sqlite3 module is unavailable. Please run...
 
   sudo pkg install py%i%i-sqlite3
-""" % (sys.version_info[:2])
+""" % sys.version_info[:2]
 
 try:
   import sqlite3
@@ -337,7 +337,7 @@ def data_directory(filename, config):
 
   if not os.path.exists(data_dir):
     try:
-      os.mkdir(data_dir)
+      os.makedirs(data_dir)
     except OSError as exc:
       stem.util.log.log_once('nyx.data_directory_unavailable', stem.util.log.NOTICE, 'Unable to create a data directory at %s (%s). This is fine, but caching is disabled meaning performance will be diminished a bit.' % (data_dir, exc))
       return None



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits