Sean Farley  committed ad4cb90

util: convert pickle to json

If we fallback to loading data with pickle, then we immediately save the data
in json format to avoid any pickling in the future.

  • Participants
  • Parent commits 6e4892b
  • Branches default

Comments (0)

Files changed (1)

File hgsubversion/

     f = open(file_path)
         data = _convert(json.load(f), _descrub)
+        f.close()
     except ValueError:
         # Ok, JSON couldn't be loaded, so we'll try the old way of using pickle
         data = pickle.load(f)
-    f.close()
+        # convert the file to json immediately
+        f.close()
+        dump(data, file_path)
     return data
 def parseurl(url, heads=[]):