Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

get_contents_as_string() returns empty string for nonempty key #1430

Open
bwaldrep opened this Issue · 0 comments

1 participant

Bill Waldrep
Bill Waldrep
conn = S3Connection()
bucket = conn.get_bucket(<my bucket name>)
s3key = Key(bucket)
s3key.key = <my key>
result = s3key.get_contents_as_string()

I am writing unit tests for a logger that periodically flushes logs to an S3 bucket. After flushing the logs to S3 I can verify that the key exists using bucket.list() and the AWS console. However, get_contents_as_string() always returns the empty string. Running the test again looking for a key created on a previous test returns the correct value, as does downloading the file from S3 manually.

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.