Skip to content

Commit

Permalink
Fixes #1360 - paging not working correctly for multipart command
Browse files Browse the repository at this point in the history
When listing multipart uploads over multiple pages, "key-marker" and
"upload-id-marker" are the correct names for the query parameters to go
to the next page.
  • Loading branch information
fviard committed Dec 19, 2023
1 parent a911b88 commit dbdee8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions S3/S3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1411,22 +1411,22 @@ def get_multipart_streaming(self, uri, uri_params=None, limit=-1):
next_key = getTextFromXml(xml_data, "NextKeyMarker")
if not next_key:
next_key = upload_list[-1]["Key"]
uri_params['KeyMarker'] = next_key
uri_params['key-marker'] = next_key

upload_id_marker = getTextFromXml(
xml_data, "NextUploadIdMarker")
if upload_id_marker:
uri_params['UploadIdMarker'] = upload_id_marker
elif 'UploadIdMarker' in uri_params:
uri_params['upload-id-marker'] = upload_id_marker
elif 'upload-id-marker' in uri_params:
# Clear any pre-existing value
del uri_params['UploadIdMarker']
del uri_params['upload-id-marker']
else:
# Unexpectedly, the server lied, and so the previous
# response was not truncated. So, no new key to get.
yield False, upload_list
break
debug("Listing continues after '%s'" %
uri_params['KeyMarker'])
uri_params['key-marker'])
else:
yield truncated, upload_list
break
Expand Down

0 comments on commit dbdee8f

Please sign in to comment.