Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import: strange error with path ending in / #2237

Closed
jorgeorpinel opened this issue Jul 5, 2019 · 2 comments · Fixed by #2248
Closed

import: strange error with path ending in / #2237

jorgeorpinel opened this issue Jul 5, 2019 · 2 comments · Fixed by #2248
Assignees
Labels
bug Did we break something? p1-important Important, aka current backlog of things to do

Comments

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Jul 5, 2019

DVC version: 0.50.1
Python version: 3.7.3
Platform: Darwin-18.6.0-x86_64-i386-64bit

First dvc init an empty DVC repo and run the following inside. In my case the working dir is called emptydvcrepo.

$ dvc import https://github.com/iterative/example-get-started data/prepared/
...
ERROR: failed to import 'data/prepared/' from
'https://github.com/iterative/example-get-started'. - current working directory
'/path/to/emptydvcrepo' is specified as an output in 'emptydvcrepo.dvc'. Use another CWD
to prevent any data removal.

Notice the given path, data/prepared/ ending with / and the error mentioning an inexistent DVC-file called emptydvcrepo.dvc.

It works normally without the slash.

@jorgeorpinel jorgeorpinel changed the title import: error with path ending in / import: strange error with path ending in / Jul 5, 2019
@efiop efiop added bug Did we break something? p1-important Important, aka current backlog of things to do labels Jul 5, 2019
@MalaysiaMariuane

This comment was marked as spam.

@pared pared self-assigned this Jul 9, 2019
@pared
Copy link
Contributor

pared commented Jul 9, 2019

The problem is that when generating default default_out name in imp_url we do not normalize path, so basename for anything ending with '/' will be ``, which will lead to some strange behaviour, like creating stage file with repo directory name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something? p1-important Important, aka current backlog of things to do
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants