519
519
mutter("FTP nlst: %s", basepath)
520
520
f = self._get_FTP()
522
paths = f.nlst(basepath)
523
except ftplib.error_perm, e:
524
self._translate_perm_error(e, relpath, extra='error with list_dir')
525
except ftplib.error_temp, e:
526
# xs4all's ftp server raises a 450 temp error when listing an empty
527
# directory. Check for that and just return an empty list in that
528
# case. See bug #215522
529
if str(e).lower().startswith('450 no files found'):
530
mutter('FTP Server returned "%s" for nlst.'
531
' Assuming it means empty directory',
523
paths = f.nlst(basepath)
524
except ftplib.error_perm, e:
525
self._translate_perm_error(e, relpath,
526
extra='error with list_dir')
527
except ftplib.error_temp, e:
528
# xs4all's ftp server raises a 450 temp error when listing an
529
# empty directory. Check for that and just return an empty list
530
# in that case. See bug #215522
531
if str(e).lower().startswith('450 no files found'):
532
mutter('FTP Server returned "%s" for nlst.'
533
' Assuming it means empty directory',
536
538
# Restore binary mode as nlst switch to ascii mode to retrieve file