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.