Skip to content

dvc: update file utilities #2137

@Suor

Description

@Suor

Some file utilities live in dvc.utils.fs while some other in dvc.utils.__init__. I suggest grouping them in a single place.

Also, some of them accept Path-like objects, i.e. Path, PurePath, PathInfo, etc and some do not. This makes people guess at the call site whether they need to wrap arguments into fspath(), fspath_py35() or none. So I propose that our file utilities will always accept that, this way we will concentrate those wrapper call in one place and remove the guessing part, at least for our own functions, calling os.path.*() will still need wrapping as long as we use Python 3.5-.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions