question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add: give ‘does not exist ERROR’ if a file with a leading question mark is given

See original GitHub issue

Bug Report

Description

see Issue name.

Reproduce

I have a dvc folder data with has two files test?test.txt and ?test.txt:

.
└── data
    ├── test?test.txt
    └── ?test.txt

1 directory, 3 files

If I try to add ?test.txt I get this error:

$ dvc add data/\?test.txt
Adding...                                                                               
ERROR: output 'data?test.txt' does not exist

Apparently DVC things I want to add data?test.txt and yes this file does not exist, but this is not what I wanna add. The other file data/test?test.txt I can add without any problems. I thing there is a problem with the leading question mark. I also tested this witch a leading ‘#’, same problem.

My question is: Is this on purpose? I noticed the behavior in DVC version 2.18.1 or so. Befor I hat no problem with leading question marks.

Expected

Just add the file.

Environment information

DVC version: 2.20.0 (deb)
---------------------------------
Platform: Python 3.8.3 on Linux-5.4.0-125-generic-x86_64-with-glibc2.14
Supports:
	http (aiohttp = 3.8.1, aiohttp-retry = 2.8.3),
	https (aiohttp = 3.8.1, aiohttp-retry = 2.8.3),
	ssh (sshfs = 2022.6.0)
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/sda2
Caches: local
Remotes: None
Workspace directory: ext4 on /dev/sda2
Repo: dvc, git

Additional Information (if any):

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
samuelkeescommented, Aug 29, 2022

I tested it with DVC version 2.18.0; all cool. DVC version 2.18.1 i get the same error.

$ tree
.
`-- data
    `-- ?test.txt

1 directory, 1 file
$ dvc --version
2.18.0

$ dvc add data/\?test.txt 
WARNING: 'data/?test.txt' is empty.                                                                                                               
100% Adding...|██████████████████████████████████████████████████████████████████████████████████████████████████████████|1/1 [00:00, 24.07file/s]
                                                                                                                                                  
To track the changes with git, run:

	git add data/.gitignore 'data/?test.txt.dvc'

To enable auto staging, run:

	dvc config core.autostage true

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyCharm tells me "Cannot start process, the working directory ...
When I run my python main file, PyCharm keeps telling me Cannot start process, the working directory /home/myname/PyCharmProjects/MyProjectName/mypackage does ...
Read more >
How do I make rm not give an error if a file doesn't exist?
I use set -e in all my bash scripts so that the script exits after any command gives an error. I often want...
Read more >
How the Question Mark (?) Operator Works in JavaScript
The conditional or question mark operator, represented by a ?, is one of the most powerful features in JavaScript. The ? operator is...
Read more >
Errors using special characters in Access databases - Office
Lists the special characters to avoid using when you work with the database object names or the field names in all versions of...
Read more >
Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
When used with function calls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found