Skip to content

Commit 738a9cc

Browse files
Add reason for version fetching and invalidation
1 parent 197c0e2 commit 738a9cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

s3fs/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,9 @@ def __init__(self, s3, path, mode='rb', block_size=5 * 2 ** 20, acl="",
928928
self.size = self.details['size']
929929
elif self.fs.version_aware:
930930
self.version_id = self.details.get('VersionId')
931+
# In this case we have not managed to get the VersionId out of details and
932+
# we should invalidate the cache and perform a full head_object since it
933+
# has likely been partially populated by ls.
931934
if self.version_id is None:
932935
self.fs.invalidate_cache(self.path)
933936
self.details = self.fs.info(self.path)

0 commit comments

Comments
 (0)