PyFilesystem / pyfilesystem

Python filesystem abstraction layer
http://pyfilesystem.org/
BSD 3-Clause "New" or "Revised" License
288 stars 63 forks source link

TypeError when sftp connection fails #206

Open ThiefMaster opened 9 years ago

ThiefMaster commented 9 years ago
[adrian@blackhole:~/dev/indico/src:wip/attachments *%]> fsls sftp://blackhole/tmp/
fsnotifier-remote.log  krb5cc_1000  maildump.pid  maildump.sqlite  portage  tmux-0  tmux-1000

[adrian@blackhole:~/dev/indico/src:wip/attachments *%]> fsls sftp://nosuchuser@blackhole/tmp/
Traceback (most recent call last):
  File "/home/adrian/dev/indico/env/bin/fsls", line 9, in <module>
    load_entry_point('fs==0.5.2', 'console_scripts', 'fsls')()
  File "/home/adrian/dev/indico/env/lib/python2.7/site-packages/fs/commands/fsls.py", line 172, in run
    return FSls().run()
  File "/home/adrian/dev/indico/env/lib/python2.7/site-packages/fs/commands/runner.py", line 354, in run
    self.error(self.wrap_error(unicode(e)) + '\n')
  File "/home/adrian/dev/indico/env/lib/python2.7/site-packages/fs/errors.py", line 72, in __unicode__
    return unicode(self.msg, encoding=sys.getfilesystemencoding(), errors='replace') % keys
TypeError: decoding Unicode is not supported
[adrian@blackhole:~/dev/indico/src:wip/attachments *%]>
ThiefMaster commented 9 years ago

The patch in #184 seems to fix it