-
Notifications
You must be signed in to change notification settings - Fork 184
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
Globing remote path fails on pattern with spaces #322
Comments
Step one: make a test: @skip_on_windows
def test_glob_spaces(self):
fileloc = local.cwd / 'file with space.txt'
assert fileloc.exists()
assert local.cwd // "*space.txt"
assert local.cwd // "file with*" (Ignore my incorrect comment earlier) Okay, now the remote test: def test_glob_spaces(self):
with self._connect() as rem:
with rem.cwd(os.path.dirname(os.path.abspath(__file__))):
filenames = [f.name for f in rem.cwd // ("*space.txt")]
assert "file with space.txt" in filenames
filenames = [f.name for f in rem.cwd // ("*with space.txt")]
assert "file with space.txt" in filenames # fails |
henryiii
added a commit
that referenced
this issue
May 25, 2017
henryiii
added a commit
that referenced
this issue
May 25, 2017
Wow! That was fast! Maybe more tests? 👍 In [7]: def test_glob_spaces():
...: fileloc = remote.cwd / '$fde33.txt'
...: assert fileloc.exists()
...:
...: assert local.cwd // "*33.txt"
...: assert local.cwd // "$*"
...: test_glob_spaces()
...:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-7-256c51189937> in <module>()
5 assert local.cwd // "*33.txt"
6 assert local.cwd // "$*"
----> 7 test_glob_spaces()
<ipython-input-7-256c51189937> in test_glob_spaces()
3 assert fileloc.exists()
4
----> 5 assert local.cwd // "*33.txt"
6 assert local.cwd // "$*"
7 test_glob_spaces()
AssertionError: |
You could fix that one if you want; I'm not too worried about it since a filename with a |
henryiii
added a commit
that referenced
this issue
Jun 5, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
When you glob a file and pattern contain spaces it returns nonexistent files
yields this:
I've searched the repo and the problem seems in this line. It seems that there is no escaping going on.
I would have fixed that, but I don't know how does escaping works.
The text was updated successfully, but these errors were encountered: