Arround line 700, we got :
for item in arg:
if isinstance(item, int):
elif isinstance(item, long):
elif isinstance(item, str):
elif isinstance(item, SFTPAttributes):
raise Exception('unknown type for %r type %r' % (item, type(item)))
Which mean you can't pass subclasses of unicode there. Either you make this check :
Or you make an explicit message explaining you reject non encoded strings. Otherwise, it's hard to understand what's going on when you get :
Exception: unknown type for unicode_subclass(u'/stuff') type <class 'us.us'>
Thanks for looking out! This should have been fixed in the recent merge of Python 3 support; that line now looks like this: https://github.com/paramiko/paramiko/blob/e032541b787e74510aa66b0a243ffc1d1a61b7f4/paramiko/sftp_client.py#L660 - and string_types under Python 2 is basestring.
This change is live in version 1.13 and I will go backport it to a few older branches that are Python 2 only; their next bugfix releases will have the change.