Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

S3 get_contents_as_string() returns empty string after InvalidRange error #520

Open
vsekhar opened this Issue · 0 comments

1 participant

@vsekhar

After requesting a range that cannot be satisfied, a subsequent (valid) range request returns the empty string. Requesting the valid range again produces the correct result.

Steps to reproduce in 2.1.1:

import boto
c = boto.connect_s3()
b = c.get_bucket('mybucket')
k = b.get_key('small_file') # contains 5 bytes: '12345'

k.get_contents_as_string(headers={'Range': 'bytes=%s-%s' % (0, 100)}) # returns '12345'
k.get_contents_as_string(headers={'Range': 'bytes=%s-%s' % (80, 100)}) # raises 416 Requested Range Not Satisfiable
k.get_contents_as_string(headers={'Range': 'bytes=%s-%s' % (0, 100)}) # BUG: returns '' instead of '12345'
k.get_contents_as_string(headers={'Range': 'bytes=%s-%s' % (0, 100)}) # returns '12345'
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.