ploxiln/fab-classic

[Bug] rsync_project exclude flag broken in Python3+

Closed this issue · 2 comments

Python3 added the __iter__ attribute to strings so the following check doesn't work:

if not hasattr(exclude, '__iter__'):
exclude = (exclude,)

This results in the exclude rsync flag splitting up a string like HELLO into H E L L O.

Looking at the newer Fabric's rsync they do the following:

https://github.com/fabric/patchwork/blob/d653591cc8130765978a91d02c4cd108e76cca06/patchwork/transfers.py#L82-L83

With six.string_types switching depending on whether they are using Py3 or 2:

https://github.com/pyinvoke/invoke/blob/45dc9d03639dac5b6d1445831bf270e686ef88b4/invoke/vendor/six.py#L40-L49

An easy workaround for now is to either move the exclude arguments into the extra_opts flag or to do exclude=["single-string"]

Thanks for the report!