mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 15:28:28 +01:00
yaml: use safe_load and safe_dump
We don't need to support python objects in our dvc files, so we should only use safe_ functionality to avoid possible bugs when entries in dvc files are represented as py objects. Fixes #372
This commit is contained in:
+2
-2
@@ -247,7 +247,7 @@ class Stage(object):
|
||||
@staticmethod
|
||||
def load(project, fname):
|
||||
with open(fname, 'r') as fd:
|
||||
return Stage.loadd(project, yaml.load(fd), fname)
|
||||
return Stage.loadd(project, yaml.safe_load(fd), fname)
|
||||
|
||||
def dumpd(self):
|
||||
deps = [x.dumpd(self.cwd) for x in self.deps]
|
||||
@@ -265,7 +265,7 @@ class Stage(object):
|
||||
fname = self.path
|
||||
|
||||
with open(fname, 'w') as fd:
|
||||
yaml.dump(self.dumpd(), fd, default_flow_style=False)
|
||||
yaml.safe_dump(self.dumpd(), fd, default_flow_style=False)
|
||||
|
||||
def save(self):
|
||||
for dep in self.deps:
|
||||
|
||||
Reference in New Issue
Block a user