Skip to content

Commit

Permalink
Remove advanced shell expansion syntax from upload_template
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet authored and ojrac committed Oct 9, 2019
1 parent ed45c79 commit 81edabc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fabric/contrib/files.py
Expand Up @@ -160,7 +160,8 @@ def upload_template(filename, destination, context=None, use_jinja=False,

# Back up original file
if backup and exists(destination):
func("cp %s{,.bak}" % _expand_path(destination))
target = _expand_path(destination)
func("cp %s %s.bak" % (target, target))

if six.PY3 is True and isinstance(text, bytes):
text = text.decode('utf-8')
Expand Down
4 changes: 4 additions & 0 deletions sites/www/changelog.rst
Expand Up @@ -2,6 +2,10 @@
Changelog
=========

* :bug:`1227` Remove a bash/zsh-ism from
`~fabric.contrib.files.upload_template` when backing up the target file,
preventing issues on simpler remote shells. Patch courtesy of Paul
Chakravarti.
* :bug:`983` Move a ``getpass`` import inside a Windows-oriented
``try``/``except ImportError`` so password prompting is less likely to
explode on certain systems. Thanks to ``@dongweiming`` for the patch.
Expand Down

0 comments on commit 81edabc

Please sign in to comment.