Skip to content

Commit

Permalink
Merge pull request #1695 from pared/1640
Browse files Browse the repository at this point in the history
yaml loading error: display relative path
  • Loading branch information
efiop authored Mar 13, 2019
2 parents 5530125 + 161d3ce commit 64e5b1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def __init__(self):

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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def test(self):
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:
Expand Down

0 comments on commit 64e5b1e

Please sign in to comment.