Skip to content

Conversation

@efiop
Copy link
Contributor

@efiop efiop commented Sep 12, 2019

Unlike original implementation [1] that uses str() we actually need
to use fspath, because we've overriden __str__ method to return
relative paths, which will break original as_posix.

[1] https://github.com/python/cpython/blob/v3.7.0/Lib/pathlib.py#L692

Fixes #2483

Signed-off-by: Ruslan Kuprieiev ruslan@iterative.ai

  • Have you followed the guidelines in our
    Contributing document?

  • Does your PR affect documented changes or does it add new functionality
    that should be documented? If yes, have you created a PR for
    dvc.org documenting it or at
    least opened an issue for it? If so, please add a link to it.


@efiop efiop changed the title path_info: don't forget to override as_posix method [WIP] path_info: don't forget to override as_posix method Sep 12, 2019
Unlike original implementation [1] that uses `str()` we actually need
to use `fspath`, because we've overriden `__str__` method to return
relative paths, which will break original `as_posix`.

[1] https://github.com/python/cpython/blob/v3.7.0/Lib/pathlib.py#L692

Fixes treeverse#2483

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
@efiop efiop changed the title [WIP] path_info: don't forget to override as_posix method path_info: don't forget to override as_posix method Sep 13, 2019
@efiop efiop merged commit 6d16227 into treeverse:master Sep 13, 2019
@efiop efiop deleted the 2483 branch September 13, 2019 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dvc run : possible bug with deeply nested dependencies

1 participant