Skip to content

"AttributeError: NoneType object has no attribute 'wdir'" on dvc get-url call #3897

@nickdelgrosso

Description

@nickdelgrosso

Bug Report

When calling dvc get-url gdrive://{mylink} from the command line, I am getting the following AttributeError: "NoneType' object has no attribute 'wdir'. The full traceback is below.

I'm calling dvc get-url from outside the .dvc working directory. A quick look at the source code suggests that this is related to output.LocalOutput being initialized with stage=None from the dependency.loads_from() function in repo.get_url.py.

Please provide information about your setup

Output of dvc version:

$ dvc version
DVC version: 0.94.0
Python version: 3.7.6
Platform: Windows-10-10.0.18362-SP0
Binary: False
Package: pip
Supported remotes: gdrive, http, https
Filesystem type (workspace): ('NTFS', 'C:\\')

Additional Information (if any):

Traceback (most recent call last):
  File "d:\miniconda3\lib\site-packages\dvc\main.py", line 49, in main
    ret = cmd.run()
  File "d:\miniconda3\lib\site-packages\dvc\command\get_url.py", line 17, in run
    Repo.get_url(self.args.url, out=self.args.out)
  File "d:\miniconda3\lib\site-packages\dvc\repo\get_url.py", line 17, in get_url
    (dep,) = dependency.loads_from(None, [url])
  File "d:\miniconda3\lib\site-packages\dvc\dependency\__init__.py", line 83, in loads_from
    ret.append(_get(stage, s, info))
  File "d:\miniconda3\lib\site-packages\dvc\dependency\__init__.py", line 68, in _get
    return LocalDependency(stage, p, info)
  File "d:\miniconda3\lib\site-packages\dvc\output\local.py", line 25, in __init__
    super().__init__(stage, path, *args, **kwargs)
  File "d:\miniconda3\lib\site-packages\dvc\output\base.py", line 98, in __init__
    self.path_info = self._parse_path(remote, path)
  File "d:\miniconda3\lib\site-packages\dvc\output\local.py", line 40, in _parse_path
    p = self.stage.wdir / p
AttributeError: 'NoneType' object has no attribute 'wdir'

Metadata

Metadata

Assignees

Labels

awaiting responsewe are waiting for your reply, please respond! :)bugDid we break something?p1-importantImportant, aka current backlog of things to do

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions