diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-02-20 12:39:28 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-02-20 12:39:28 -0800 |
commit | 2c8278a057e733c1bac907de13bc91ad29e80a09 (patch) | |
tree | 660aeae2fb1fe0beff460733a37c48f1bfdd88c6 | |
parent | cc7182116ee72da6728e19177f355936385d389e (diff) | |
download | paramiko-sftp-non-utf8-filenames-546.tar.gz |
Push bad test that fails because server needs fixing too!sftp-non-utf8-filenames-546
Re #546
-rwxr-xr-x | tests/test_sftp.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index d3064fff..3d472ab8 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -676,6 +676,20 @@ class SFTPTest (unittest.TestCase): self.fail('exception ' + str(e)) sftp.unlink(b(FOLDER) + utf8_folder) + def test_encoding_errors_replaced(self): + """ + verify that string decode errors get replaced in listdir_* + """ + badpath = FOLDER + '/badfilename-\xff' + with sftp.open(badpath, 'w') as f: + f.write('okay') + + try: + sftp.listdir_attr(FOLDER) + except Exception as e: + self.fail('exception ' + str(e)) + sftp.unlink(badpath) + def test_L_utf8_chdir(self): sftp.mkdir(FOLDER + '/' + unicode_folder) try: |