Skip to content

S3 key copy does not work if the key starts with a slash #1853

brentpayne opened this Issue Nov 12, 2013 · 0 comments

1 participant


Another key starts with a slash issue.

    srcBucket =s3.get_bucket('brightscope_audit_reports')
    destBucket = s3.get_bucket(new_bucket)

    key = srcBucket.new_key('hello.txt')
    key.set_contents_from_string('Hello World!')
    print srcBucket.get_key('hello.txt').get_contents_as_string()
    print destBucket.get_key('hello.txt').get_contents_as_string()
    #The above works

    key = srcBucket.new_key('/hello.txt')
    key.set_contents_from_string('Hello Slash!')
    print srcBucket.get_key('/hello.txt').get_contents_as_string()
    key.copy(new_bucket, #Exception thrown here
    print destBucket.get_key('/hello.txt').get_contents_as_string()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.