Skip to content
Browse files

fix sync single remote file to existing local file traceback, bug 88

fixes #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.
  • Loading branch information...
1 parent 454c20e commit 30cea492e5f2bc30c0b46d0db1164e144249988f @mdomsch mdomsch committed with mdomsch Mar 8, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 s3cmd
2 s3cmd
@@ -746,6 +746,8 @@ def cmd_sync_remote2local(args):
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))
def _set_local_filename(remote_list, destination_base):
+ if len(remote_list) == 0:
+ return
if not os.path.isdir(destination_base):
## We were either given a file name (existing or not) or want STDOUT
if len(remote_list) > 1:

0 comments on commit 30cea49

Please sign in to comment.
Something went wrong with that request. Please try again.