Permalink
Browse files

fix sync --dry-run traceback, bug #124

Bug 124: s3tools#124

s3cmd sync --dry-run --recursive BLAH/ s3://blah-blah-blah
would traceback:

File "/usr/local/bin/s3cmd", line 1075, in _child
    output(u"remote copy: %s -> %s" % (dst1['object_key'],
    remote_list[dst2]['object_key']))
TypeError: string indices must be integers

In this case, dst1 and dst2, coming from copy_pairs, are themselves
the strings we want, not a lookup into a list.  So use them directly.
  • Loading branch information...
1 parent cdf809f commit b7c990ac62a8a7884409bbf672d0b55f49ba7ae7 @mdomsch committed with Mar 1, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 s3cmd
View
2 s3cmd
@@ -1080,7 +1080,7 @@ def cmd_sync_local2remote(args):
for key in update_list:
output(u"upload: %s -> %s" % (update_list[key]['full_name_unicode'], update_list[key]['remote_uri']))
for (src_obj, dst1, dst2) in copy_pairs:
- output(u"remote copy: %s -> %s" % (dst1['object_key'], remote_list[dst2]['object_key']))
+ output(u"remote copy: %s -> %s" % (dst1, dst2))
if cfg.delete_removed:
for key in remote_list:
output(u"delete: %s" % remote_list[key]['object_uri_str'])

0 comments on commit b7c990a

Please sign in to comment.