Merge pull request #1692 from sanjeevsuresh/exception-when-missing-key

BugFix: Exception in ListObjectVersions with a Prefix that Returns an Empty Result Set
This commit is contained in:
Steve Pulec 2018-07-19 09:41:44 -04:00 committed by GitHub
commit 786ec0501e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View file

@ -718,7 +718,7 @@ class S3Backend(BaseBackend):
if key_name in bucket.keys:
key = bucket.keys[key_name]
else:
for key_version in bucket.keys.getlist(key_name):
for key_version in bucket.keys.getlist(key_name, default=[]):
if str(key_version.version_id) == str(version_id):
key = key_version
break