fixes https://github.com/s3tools/s3cmd/issues/88
We were getting a traceback:
remote_list[remote_list.keys()[0]]['local_filename'] = deunicodise(destination_base)
IndexError: list index out of range
In this instance, remote_list length is 0 because the file is on the
update_list instead. We'll get to process that in a bit. The right
thing to do in _set_local_filename() is to simply return if the list
length is zero - there's nothing for us to do.
... | ... |
@@ -746,6 +746,8 @@ def cmd_sync_remote2local(args): |
746 | 746 |
info(u"Summary: %d remote files to download, %d local files to delete, %d local files to hardlink" % (remote_count + update_count, local_count, copy_pairs_count)) |
747 | 747 |
|
748 | 748 |
def _set_local_filename(remote_list, destination_base): |
749 |
+ if len(remote_list) == 0: |
|
750 |
+ return |
|
749 | 751 |
if not os.path.isdir(destination_base): |
750 | 752 |
## We were either given a file name (existing or not) or want STDOUT |
751 | 753 |
if len(remote_list) > 1: |