Skip to content

dvc list: Error on empty directory.  #5841

@karajan1001

Description

@karajan1001

Bug Report

Got error message on an empty directory, shouldn't it show nothing? like ls command.

Description

image
Error when list a empty path, strange behavior.
Might relate to

dvc/dvc/repo/ls.py

Lines 40 to 41 in daf0745

if path and not ret:
raise PathMissingError(path, repo, dvc_only=dvc_only)

Reproduce

  1. git init
  2. dvc init
  3. mkdir empty
  4. dvc list . empty

Expected

Show nothing like ls command
image

Environment information

DVC version: 2.0.17+7e4851

Platform: Python 3.8.8 on macOS-10.16-x86_64-i386-64bit
Supports: All remotes
Cache types: https://error.dvc.org/no-dvc-cache
Caches: local
Remotes: None
Workspace directory: apfs on /dev/disk3s1s1
Repo: dvc, git

Output of dvc doctor:

$ dvc doctor

Additional Information (if any):

Metadata

Metadata

Assignees

Labels

A: statusRelated to the dvc diff/list/statusbugDid we break something?p2-mediumMedium priority, should be done, but less important

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions