old_contents: import os
  import codecs
  import json
  
  
  class JsonFile:
  
      def __init__(self, fpath, encoding="utf-8"):
          self.encoding = encoding
          self.fpath = fpath
  
      def load(self, default=[]):
          self.fdir = os.path.dirname(self.fpath)
          if not os.path.isdir(self.fdir):
              os.makedirs(self.fdir)
          if os.path.exists(self.fpath):
              f = codecs.open(self.fpath, "r+", encoding=self.encoding)
              try:
                  data = json.load(f)
              except:
                  data = default
              f.close()
          else:
              f = codecs.open(self.fpath, "w+", encoding=self.encoding)
              data = default
              f.close()
          return data
  
      def save(self, data, indent=4):
          self.fdir = os.path.dirname(self.fpath)
          if not os.path.isdir(self.fdir):
              os.makedirs(self.fdir)
          f = codecs.open(self.fpath, "w+", encoding=self.encoding)
          f.write(json.dumps(data, ensure_ascii=False, indent=indent))
          f.close()
  
      def remove(self):
          if os.path.exists(self.fpath):
              os.remove(self.fpath)
  
new_contents: import os
  import codecs
  import sublime
  
  
  class JsonFile:
      def __init__(self, fpath, encoding="utf-8"):
          self.encoding = encoding
          self.fpath = fpath
  
      def load(self, default=[]):
          self.fdir = os.path.dirname(self.fpath)
          if not os.path.isdir(self.fdir):
              os.makedirs(self.fdir)
          if os.path.exists(self.fpath):
              f = codecs.open(self.fpath, "r+", encoding=self.encoding)
              try:
                  content = f.read()
                  data = sublime.decode_value(content)
              except:
                  print("%s is bad!" % self.fpath)
                  f.close()
                  raise
              if not data:
                  data = default
              f.close()
          else:
              f = codecs.open(self.fpath, "w+", encoding=self.encoding)
              data = default
              f.close()
          return data
  
      def save(self, data, indent=4):
          self.fdir = os.path.dirname(self.fpath)
          if not os.path.isdir(self.fdir):
              os.makedirs(self.fdir)
          f = codecs.open(self.fpath, "w+", encoding=self.encoding)
          f.write(sublime.encode_value(data, True))
          f.close()
  
      def remove(self):
          if os.path.exists(self.fpath):
              os.remove(self.fpath)
  
subject: fix #44