Merge pull request #532 from efiop/master

dvc: switch from yaml to json for dir cache file
This commit is contained in:
Ruslan Kuprieiev
2018-03-09 08:40:07 +02:00
committed by GitHub
+3 -3
View File
@@ -1,6 +1,6 @@
import os
import stat
import yaml
import json
from checksumdir import dirhash
from dvc.system import System
@@ -249,7 +249,7 @@ class Output(Dependency):
try:
with open(path, 'r') as fd:
d = yaml.safe_load(fd)
d = json.load(fd)
except Exception as exc:
msg = u'Failed to load dir cache \'{}\''
Logger.error(msg.format(relpath), exc)
@@ -349,7 +349,7 @@ class Output(Dependency):
os.makedirs(dname)
with open(self.cache, 'w+') as fd:
yaml.safe_dump(dir_info, fd, default_flow_style=False)
json.dump(dir_info, fd)
def save(self):
super(Output, self).save()