Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixing KeyError when copying multiple keys (SourceForge bug 3091912) #20

Merged
merged 1 commit into from

4 participants

@canadianveggie

When you use 's3cmd cp' to copy multiple keys (without using the recursive flag) you get a Key Error.
s3cmd cp s3://source-bucket/prefix* s3://target-bucket

Logged here: http://sourceforge.net/tracker/?func=detail&aid=3091912&group_id=178907&atid=887015
and here: https://bugs.launchpad.net/ubuntu/+source/s3cmd/+bug/523586

@canadianveggie canadianveggie Fixing bug 3091912 - KeyError when copying multiple keys
When you use 's3cmd cp' to copy multiple keys (without using the recursive flag) you get a Key Error.
s3cmd cp s3://source-bucket/prefix* s3://target-bucket

Logged here: http://sourceforge.net/tracker/?func=detail&aid=3091912&group_id=178907&atid=887015
and here: https://bugs.launchpad.net/ubuntu/+source/s3cmd/+bug/523586
af984ba
@mludvig mludvig merged commit f49ecb3 into s3tools:master
@mludvig
Owner
@RyanGordon

This change breaks s3cmd on unix systems (Solaris SunOS 5.11). Please revert this

Owner

How so please?

/usr/bin/python doesn't exist on Solaris SunOS 5.11. python gets installed to /opt/local/bin/python

~] # which python
/opt/local/bin/python

Using /usr/bin/env allows env to choose the right path(s) to look for python, which makes the environment configurable for system administrators and development operations engineers and not tied down to one path and one path only.

Owner

That's true it shouldn't have gone through. Reverted now. Thanks for the report Ryan

Thank you sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 7, 2012
  1. @canadianveggie

    Fixing bug 3091912 - KeyError when copying multiple keys

    canadianveggie authored
    When you use 's3cmd cp' to copy multiple keys (without using the recursive flag) you get a Key Error.
    s3cmd cp s3://source-bucket/prefix* s3://target-bucket
    
    Logged here: http://sourceforge.net/tracker/?func=detail&aid=3091912&group_id=178907&atid=887015
    and here: https://bugs.launchpad.net/ubuntu/+source/s3cmd/+bug/523586
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 s3cmd
View
12 s3cmd
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
@@ -509,11 +509,11 @@ def subcmd_cp_mv(args, process_fce, action_str, message):
for key in remote_list:
remote_list[key]['dest_name'] = destination_base + key
else:
- key = remote_list.keys()[0]
- if destination_base.endswith("/"):
- remote_list[key]['dest_name'] = destination_base + key
- else:
- remote_list[key]['dest_name'] = destination_base
+ for key in remote_list:
+ if destination_base.endswith("/"):
+ remote_list[key]['dest_name'] = destination_base + key
+ else:
+ remote_list[key]['dest_name'] = destination_base
if cfg.dry_run:
for key in exclude_list:
Something went wrong with that request. Please try again.