You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
put fails with filenames containing glob patterns #812
>>> from fabric.api import put
>>> put('~/test1\[foo\].txt', '/tmp')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/fabric/network.py", line 465, in host_prompting_wrapper
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/fabric/operations.py", line 369, in put
raise ValueError(err)
ValueError: '/home/myuser/test1\[foo\].txt' is not a valid local path or glob.
>>> put('~/test2.txt', '/tmp')
[example.com] put: /home/myuser/test2.txt -> /tmp/test2.txt
['/tmp/test2.txt']
put/get support glob patterns via the stdlib's fnmatch module, which is why this is happening. That's a feature; unfortunately it doesn't seem fnmatch allows for escaping so there's no great workaround at the moment. Sorry!
I'd probably accept a patch making the globbing optional (but on by default, i.e. backwards compat) which would help in this type of situation. Will leave this open so if I have time I am reminded to do it myself.
Activity
bitprophet commentedon Jan 27, 2013
put/getsupport glob patterns via the stdlib'sfnmatchmodule, which is why this is happening. That's a feature; unfortunately it doesn't seemfnmatchallows for escaping so there's no great workaround at the moment. Sorry!I'd probably accept a patch making the globbing optional (but on by default, i.e. backwards compat) which would help in this type of situation. Will leave this open so if I have time I am reminded to do it myself.
adds flag use_glob to put, to allow raw file paths re: fabric#812
bitprophet commentedon Apr 2, 2013
See #869 yay
Add changelog, versionchanged re #869, #812
Move doc of use_glob closer to desc of default globbing
Remove env var checking behavior for use_glob.