old_contents: import os, sqlite3
  class CacheProvider(object):
  
      def __init__(self, cache_dir):
          if not os.path.exists(cache_dir):
              os.makedirs(cache_dir)
          conn = sqlite3.connect(cache_dir + 'faces.db')
          self.cache_connection = conn
          c = conn.cursor()
  
          # Create table
          c.execute('''CREATE TABLE IF NOT EXISTS faces
                       (facesum char(32) PRIMARY KEY, face_data text)''')
          self.cache_connection.commit()
  
      def get(self, key):
          c = self.cache_connection.cursor()
          c.execute("select * FROM faces WHERE facesum = ?", (key,))
          res = c.fetchone()
          return res
  
      def set(self, key, value):
          c = self.cache_connection.cursor()
          c.execute('REPLACE INTO faces (facesum, face_data) VALUES (?,?)', (key, value))
          self.cache_connection.commit()
  
      def close(self):
          self.cache_connection.close()        
new_contents: import os, sqlite3
  class CacheProvider(object):
  
      def __init__(self, cache_dir):
          if not os.path.exists(cache_dir):
              os.makedirs(cache_dir)
          conn = sqlite3.connect(cache_dir + 'faces.db')
          self.cache_connection = conn
          c = conn.cursor()
  
          # Create table
          c.execute('''CREATE TABLE IF NOT EXISTS faces
                       (facesum char(32) PRIMARY KEY, face_data text)''')
          self.cache_connection.commit()
  
      def get(self, key):
          c = self.cache_connection.cursor()
          c.execute("select * FROM faces WHERE facesum = ?", (key,))
          res = c.fetchone()
          return res[1]
  
      def set(self, key, value):
          c = self.cache_connection.cursor()
          c.execute('REPLACE INTO faces (facesum, face_data) VALUES (?,?)', (key, value))
          self.cache_connection.commit()
  
      def close(self):
          self.cache_connection.close()        
subject: fix default cache provider