mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
yaml loading error: display relative path
This commit is contained in:
@@ -212,6 +212,7 @@ class NoMetricsError(DvcException):
|
||||
|
||||
class StageFileCorruptedError(DvcException):
|
||||
def __init__(self, path):
|
||||
path = os.path.relpath(path)
|
||||
super(StageFileCorruptedError, self).__init__(
|
||||
"unable to read stage file: {} "
|
||||
"YAML file structure is corrupted".format(path)
|
||||
|
||||
+1
-1
@@ -415,7 +415,7 @@ class TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc):
|
||||
ret = main(["add", self.FOO])
|
||||
self.assertEqual(0, ret)
|
||||
|
||||
foo_stage = os.path.abspath(self.FOO + Stage.STAGE_FILE_SUFFIX)
|
||||
foo_stage = os.path.relpath(self.FOO + Stage.STAGE_FILE_SUFFIX)
|
||||
|
||||
# corrupt stage file
|
||||
with open(foo_stage, "a+") as file:
|
||||
|
||||
Reference in New Issue
Block a user